What is the problem with the following code segment?
while ((fgets(receiving array,50,file_ptr)) != EOF)
;
Answer / susie
Answer : & Explanation:
fgets returns a pointer. So the correct end of file check is
checking for != NULL.
| Is This Answer Correct ? | 6 Yes | 1 No |
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above
why array index always strats wuth zero?
Write a single line c expression to delete a,b,c from aabbcc
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
Write a program to print a square of size 5 by using the character S.
Sorting entire link list using selection sort and insertion sort and calculating their time complexity
1 Answers Infosys, Microsoft, NetApp,
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }