Today to share a few questions about several C languages

Source: Internet
Author: User
What is the output of the following program?

#include <stdio.h>
int main ()
{
int i=43;
printf ("%d\n", printf ("%d", printf ("%d", I)));
return 0;
}
Reference answer: This program will output 4321. The reason is that the value of the first output I is 43 and then the return value of printf is output! And the return value of printf is the number of characters that are output! So, after the innermost printf ("%d", I) was printed 43, then the return value of printf ("%d", 43) was printed, which was 2, and then the return value of print printf ("%d", 2) was 1. So the final result is 4321.

2. What is the value of M and N after this program is run?

#include <stdio.h>
int main ()
{
int a=4,b=3,c=2,d=1,m=2,n=2;
(m=a<b) && (n=c>d);
printf ("m=%d,n=%d", m,n);
return 0;
}
To read the full text please click on the URL C language

Today to share a few questions about several C languages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.