62 513
Assignments Done
98,8%
Successfully Done
In June 2018

Answer to Question #53467 in C for rajashree g.s.

Question #53467
#include<stdio.h>
int main()
{
int x=3,y=5;
if(x==3)
printf("\n %d",x);
else;
printf("\n %d",y);
return 0;
}
what is the logic behind this program sir.can you please explain me clearly.
Expert's answer
Condition
what is the logic behind this program sir.can you please explain me clearly.
#include
int main()
{
int x=3,y=5;
if(x==3)
printf("\n %d",x);
else
printf("\n %d",y);
return 0;
}
Solution
You are declaring the x and y variables with values 3 for x and 5 for y. Later you have two “ways”. If variable x equals 3 - program will print x variable to the console and you will see number 3. If variable x have any another values (not equals 3) - program will print y variable to the console and you will see number 5.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions