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
What is string function c?
Can you write the algorithm for Queue?
What is null pointer in c?
What does sizeof function do?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
Explain enumerated types.
Give basis knowledge of web designing ...
What is masking?
Difference between malloc() and calloc() function?
How many types of operators are there in c?
Explain what is wrong in this statement?
What is the process to generate random numbers in c programming language?
What does emoji p mean?
What is the difference between null pointer and wild pointer?
What are the 4 types of organizational structures?