• edited by
888 views

1 Answer

3 3 votes

in this question, 

char a[]='\0' -----> line giving error why because a is a character array not a character if you put \0 in double quotes look like as "\0" it will ok otherwise put \0 in { } look like as { '\0' }

if the line is corrected then the output should be "The string is not empty"   why because printf always return how many characters it printed on stdout, note that printf never print null character. therefore if(printf("%s",a)) equivalent to if(0) ===> condition fails

Position:
Show:

Related questions

1 1 vote
1 1 answer
620
620 views
Harikesh Kumar asked Jan 14, 2018
620 views
step by step compile it and provide output
1 1 vote
0 0 answers
1.5k
1.5k views
srestha asked Mar 6, 2019
1,536 views
void find(int x){ static int i=10,y=0; y=y+i; for(i;i>0;i=i-10){ if(x!=0) find(x-1); else{ printf("%d",y); } } }What will be output printed for find(4)?
1 1 vote
1 1 answer
980
980 views
Kalpataru Bose asked Jul 27, 2018
980 views
Let "if x then y else z" denote the expression and this expression can be represented ad "?xyz" using ternary prefix operatorthe prefix operator for the following express...