Advertisement
Niloy007

Mehedi's prb

Jul 23rd, 2020
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int N, i = 1;
  5.  
  6.     printf("Enter the value of N (limit): ");
  7.     scanf("%d", &N);
  8.    
  9.     while(N > 0) {
  10.         if(N == 1) {
  11.             printf("%d\n", i);
  12.         } else {
  13.             printf("%d, ", i);
  14.             i += 2;
  15.         }
  16.         N--;
  17.     }
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement