OneCompiler

Write a program in C to display the first 5 natural numbers.

179

#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");
}