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 |
In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above
code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123
main() { char not; not=!2; printf("%d",not); }
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4
18 Answers HCL, IBM, Infosys, LG Soft, Satyam,
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
To reverse an entire text file into another text file.... get d file names in cmd line