First time here? Checkout the FAQ!
x
menu search
brightness_auto
more_vert

WAP (write a program) to display first n natural numbers.

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer
#include <stdio.h>
int main()
{
    int i, n;
    printf("Enter any number: ");
    scanf("%d", &n);
    printf("Natural numbers from 1 to %d : \n", n);
    for(i=1; i<=n; i++)
    {
        printf("%d\n", i);
    }
    return 0;
}
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
...