int i;
i=2;
i++;
if(i=4)
{
printf(i=4);
}
else
{
printf(i=3);
}
output of the program ?
Answer Posted / manishsoni
it show errors,bcoz
in c language,to print anyone we want to enclose that in " ".
so both the printf statement are wrong,so it is not show
proper result.
To show proper result we show that program and describe line
to line....
#include<stdio.h>
#include<conio.h>
int main()
{
int i;
i=2;
i++;
if(i=4)
{
printf("4");
}
else
{
printf("3");
}
getch();
}
In this prg i is declare as int type,after that 2 is store
into the i after i increased by not store so there is no
affect of the i's value.
at if statement
if(i=4)
here 4 is assigned into the i variable so
if statement is look like as;
if(4)which is treat is as ;
the if statement is thought that any non zero value is true
so if statement is true..
and execute first printf statement so the value is
printf("i=4");
so the final answer or result is:
i=4;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can true be a variable name in c?
What is bss in c?
What are the string functions? List some string functions available in c.
What is dynamic memory allocation?
what do you mean by inline function in C?
What is the difference between scanf and fscanf?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What is the difference between array and pointer?
What are qualifiers?
Explain how can I make sure that my program is the only one accessing a file?
How can you find out how much memory is available?
What is ctrl c called?
Why cant I open a file by its explicit path?
What is non linear data structure in c?
What are pointers? Why are they used?