how to print 1 to 20 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to print 1 to 20

how to print 1 to 20 using while loop in c program?

28th Mar 2018, 6:00 PM
Jordan
Jordan  - avatar
1 Answer
+ 2
int x = 1; while (x <= 20) { printf("%d", x); x++; } (Obviously add the main function and include the io library)
28th Mar 2018, 6:06 PM
TurtleShell
TurtleShell - avatar