479 views

2 Answers

Best answer
1 votes
1 votes

In C, printf() returns the number of characters successfully written on the output .

  if(a=printf("hello"))//So here hello will print and return 5 which will assigned in a and condition evaluated true


  printf(“gatecse%d”,a);       //print gatecse and print the value of a

So output :hellogatecse5

selected by
1 votes
1 votes
Answer is hellogatecse5

Since printf() ----- returns the number of characters it prints and prints "hello"

so a=5

since if(a=5) ---- leads to true

statement gets printed as hellogatecse5
edited by

Related questions

0 votes
0 votes
1 answer
1
Desert_Warrior asked May 16, 2016
2,358 views
#include<stdio.h int main() { int a = 5; int b = ++a * a++; printf("%d ",b); return 0; }(a) 25 (b) 30 (c) 36 (d) Undefined Behavior
0 votes
0 votes
2 answers
2
Desert_Warrior asked May 16, 2016
8,914 views
#include<stdio.h int main() { int a = 5; switch(a) { default: a = 4; case 6: a ; case 5: a = a+1; case 1: a = a-1; } printf("%d \n",a); return 0; }(a) 5 (b) 4 (c) 3 (d) N...
0 votes
0 votes
2 answers
3