Print numbers upto n terms -
#include <stdio.h> int main() { int n,i; printf("Enter the number "); scanf("%d",&n); while (i<=n) { printf("%d,",i); i++; } return 0;
}
Output -
Enter the number 5
1,2,3,4,5,
#include <stdio.h> int main() { int n,i; printf("Enter the number "); scanf("%d",&n); while (i<=n) { printf("%d,",i); i++; } return 0;
}
Enter the number 5
1,2,3,4,5,
0 Comments