Write a program in C to display the number from 1 to 200 in a series. Print 20 numbers on one line and use all the available columns on the screen.
Write a program in C to display the number from 1 to 200 in a series.
Print 20 numbers on one line and use all the available columns on the screen.
Hint:-
Print 20 numbers on one line and use all the available columns on the screen.
#include< #include< main( ) { int i; clrscr( ); for (i=1; i < = 200; i++) { printf("%4d", i); } return(0); } |
---|
Hint:-
20 values per line = 80/20 = 4 = %4d
4 values per line = 80/4 = 20 = %20d 8 values per line = 80/8 = 10 = %10d |
---|
0 comments:
Post a Comment