#define a 10
int main()
{
printf("%d..",a);
foo();
printf("%d..",a);
return 0;
}
void foo()
{
#undef a
#define a 50
}
Answers were Sorted based on User's Feedback
main() { static int var = 5; printf("%d ",var--); if(var) main(); }
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)
what is variable length argument list?
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
Derive expression for converting RGB color parameters to HSV values
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
could you please send the program code for multiplying sparse matrix in c????