U
Umesh
Please read the comments.
Program to multiply the elements of an array with its size.
#define s 5
#include<stdio.h>
void mul(int *p)
{
for(int i=0;i<s;i++)
{
printf("%d ",*p*s);
p++;
}
}
main()
{
int a,i;
printf("Enter %d No. ",s);
for(i=0;i<s;i++)
scanf("%d",&a);
mul(a);/* it should be mul(&a) why not?*/
return 0;
}
Program to multiply the elements of an array with its size.
#define s 5
#include<stdio.h>
void mul(int *p)
{
for(int i=0;i<s;i++)
{
printf("%d ",*p*s);
p++;
}
}
main()
{
int a
printf("Enter %d No. ",s);
for(i=0;i<s;i++)
scanf("%d",&a);
mul(a);/* it should be mul(&a) why not?*/
return 0;
}