#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.
1
Expert's answer
2015-07-20T01:29:10-0400
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.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment