main()

{

while (strcmp(“some”,”some\0”))

printf(“Strings are not equal\n”);

}



main() { while (strcmp(“some”,”some\0”)) printf(“Strings are 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

Post New Answer

More C Code Interview Questions

print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


main() { extern int i; i=20; printf("%d",i); }

1 Answers   Value Labs,


What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }

1 Answers  


#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }

1 Answers  


how to return a multiple value from a function?

2 Answers   Wipro,






Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  


char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 Answers  


#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

1 Answers  


create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"

2 Answers  


main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }

1 Answers  


#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer

1 Answers  


main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }

1 Answers  


Categories