To display the numbers in the series, only 7 numbers per line
To display a series of numbers as 1 2 3 4 .......... 100. Display only five integers per line.
Hint:-
#include< #include< void main( ) { int j, p=0; for (j=1; j < = 100, j++) { printf("%d", j); p++; if (p==7) { printf("\n"); p=0; } } } |
---|
Hint:-
Method used in previous question can not be used
here. That method can be used only if 80 divided by number of values per line gives you integer answer otherwise you have to use 2nd Method. 7 values per line = 80/7 = 11.43 and therefore you can not use the earlier method. |
---|
0 comments:
Post a Comment