• edited by
903 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
632
632 views
Harikesh Kumar asked Jan 14, 2018
632 views
step by step compile it and provide output
1 1 vote
0 0 answers
1.6k
1.6k views
srestha asked Mar 6, 2019
1,592 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
1.0k
1.0k views
Kalpataru Bose asked Jul 27, 2018
1,007 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...