Computer Science, asked by rachanapatil4166, 10 months ago

#include<stdio.h>
int main()
{
int i;
if(i=0,2,3)
printf("NPTEL");
else
printf("programming on c");
printf(%d\n",i);}
what is the output


Answers

Answered by ghulamsarvar
0

Answer:

Hope last statement is not typo -

printf(%d\n",i);  -----> syntax is wrong, " is missing. It will syntax error.

Assuming its a typo, output would be : NPTEL0

statement within if is checked against the value assigned to i, here i is assigned to 0,2,3 --> when this type of assignment is there, it takes last value, or you can say first assigned to 0, then 2 then 3. if the statement would had been x=3,2,0 then x would had been assigned to 0.  

And if condition checks for 0(false) or any other number(true).

Similar questions