By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,655 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,655 IT Pros & Developers. It's quick & easy.

what is the output in if-else statement

P: 1
int x=3,y,z;
printf("x=%d y=%d z=%d,x,y,z");
Jan 7 '16 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 9,197
I don't see any if-else in here.
Jan 7 '16 #2

Expert 100+
P: 2,400
There are a couple of things wrong with your printf statement. Change it to...
Expand|Select|Wrap|Line Numbers
  1. printf("x=%d y=%d z=%d\n",x,y,z);
I moved the close-quote to the left so that x,y,z is outside the quoted string.
I terminated the format string with a newline. This insures the output appears even if that port has buffered output.

What do you get when you run the program?
Jan 7 '16 #3

Post your reply

Sign in to post your reply or Sign up for a free account.