Count to N

Lab C Beginner 10 points

Read n and print 1 to n separated by spaces.

Input

One integer ≥ 1.

Output

One line.

Example

Input

5

Output

1 2 3 4 5
Sample input available Sample output available
Editor
C

Hints

for (int i = 1; i <= n; i++) counts from 1 to n.

Solution explanation

A for loop has three parts: start, condition and step.

Show solution
#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        printf("%d", i);
        if (i < n) printf(" ");
    }
    printf("\n");
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD