Program Writing #01
Question :
Write a program in C to display the first 10 natural numbers. Go to the editor
Expected Output :
1 2 3 4 5 6 7 8 9 10
Solution :
/*
Write a program in C to display the first 10 natural numbers. Go to the editor
Expected Output :
1 2 3 4 5 6 7 8 9 10
*/
#include<stdio.h>
//void loop();
int main()
{
int a,i = 0;
number(1);
return 0;
}
int number(int n){
if(n<=10){
printf("%d ", n);
return number(n+1);
}
}
![]() |
Program Writing #01 |
Comments
Post a Comment