Computer Science, asked by mrgabru94, 2 months ago

write a program that Display numbers from 1 to 5​

Answers

Answered by Mister360
5

Explanation:

#include <stdio.h>

void main()

{

int i;

printf("The first 5 natural numbers are:\n");

for (i=1;i<=5;i++)

{

printf("%d ",i);

}

printf("\n");

}

Used language-C

Answered by MrTSR
1

C program to display numbers from 1 to 5

#include <stdio.h>

int main()

{

   int i;

   printf("The first 5 numbers are:\n");

   for (i = 1; i <= 5; i++)

       printf("%d ", i);

}

OUTPUT

The first 5 numbers are:

1 2 3 4 5

=>Program has been run in the above attachment

Attachments:
Similar questions