#include <stdio.h> void main() { int number; for (number=1; number<=10; number++) { printf(“%d”,number); } }
Output
1 2 3 4 5 6 7 8 9 10
#include <stdio.h> int main() { int number=1; while(number<=10) { printf(“%dt”,number); number++; } }
#include <stdio.h> int main() { int number=5; do { printf(“%dn”,number); number++; } while(number>10); printf(“Num is not greater than 10”); }
5 Num is not greater than 10