3 like 0 dislike

Remember that printf() returns the number of displayed characters.

 

#include <stdio.h>

int main()

{

int i;

for(i = 0; printf("%d", i++) < 2;)

printf("\nEnd = %d\n", i);

return 0;

        }

 

References: C From Theory

[Normal] Essay (Open question) - asked in Introduction to Computer Programming I (C) by (20.9k points)
ID: 21868 - Available when: Unlimited - Due to: Unlimited
| 48 views
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:3.230.144.31
©2016-2021

Related questions

3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 12, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21933 - Available when: Unlimited - Due to: Unlimited
| 77 views
3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 12, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21932 - Available when: Unlimited - Due to: Unlimited
| 58 views
3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 12, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21928 - Available when: Unlimited - Due to: Unlimited
| 72 views
3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 12, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21924 - Available when: Unlimited - Due to: Unlimited
| 65 views
3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 12, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21922 - Available when: Unlimited - Due to: Unlimited
| 82 views
12,116 questions
158,015 answers
158,423 comments
4,515 users