main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
}
Answer / susie
Answer :
No output
Explanation:
Ending the string constant with \0 explicitly makes no
difference. So “some” and “some\0” are equivalent. So,
strcmp returns 0 (false) hence breaking out of the while loop.
Is This Answer Correct ? | 3 Yes | 0 No |
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
How to access command-line arguments?
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }