void main()

{

int i;

char a[]="\0";

if(printf("%s\n",a))

printf("Ok here \n");

else

printf("Forget it\n");

}

Answers were Sorted based on User's Feedback



void main() { int i; char a[]="\0"; if(printf("%s\n",a)) pri..

Answer / susie

Answer :

Ok here

Explanation:

Printf will return how many characters does it print. Hence
printing a null character returns 1 which makes the if
statement true, thus "Ok here" is printed.

Is This Answer Correct ?    14 Yes 4 No

void main() { int i; char a[]="\0"; if(printf("%s\n",a)) pri..

Answer / rahul bagale

Ans :Forget it

Explation:

'' is a char with value 0 in C++ and an int with the value 0 in C.

Is This Answer Correct ?    1 Yes 3 No

void main() { int i; char a[]="\0"; if(printf("%s\n",a)) pri..

Answer / sunder.r

answewr: forget it

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Code Interview Questions

main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }

2 Answers  


how to test pierrot divisor

0 Answers  


Is the following code legal? typedef struct a { int x; aType *b; }aType

1 Answers  


write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?

1 Answers  


write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .

2 Answers  






main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above

2 Answers   HCL, LG,


write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }

2 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


Sir... please give some important coding questions asked by product companies..

0 Answers  


main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }

1 Answers  


Categories