which program to print the product all natural numbers from 1 to a given number​

which program to print the product all natural numbers from 1 to a given number​

About the author
Aaliyah

1 thought on “which program to print the product all natural numbers from 1 to a given number​”

  1. #include <stdio.h>

    #include<conio.h>

    int main()

    {

    int i, n;

    clrscr();

    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;

    getch();

    }

    Reply

Leave a Reply to Ivy Cancel reply