Define a macro that receives an array and the number of elements in the array as arguments. Write a C program for using this macro to print the elements of the array.
Program Code:
#include<stdio.h>
#define PRINTARRAY(a,l)\
int i=0; \
while(i<l) \
{ \
printf("%5d",a[i]);\
i++; \
}
void main()
{
int a[10]={10,25,47,56,89,34,68,45,28,03};
PRINTARRAY(a,10);
}
Post A Comment:
0 comments: