Feb 8, 2020

C Program to print your name 10 times without using loops or goto statement, using recursion function

Ex: Write a C Program to print your name 10 times without using loops or goto statement using recursion function. How to write a C Program to print your name 10 times without using loops or goto statement using recursion function. C Program to print your name 10 times without using loops or goto statement using recursion function.


In below program we have used recursion function to print name 10 times.

What is recursion function?
Recursion function means function calling it self ...In simple words recursion() means call a function inside the same function then it is called a recursive call of the function.




Program:

#include<stdio.h>
void rec(int i)
{
if(i<=10)
{
printf("%02d omkar\n",i);
rec(i+1);
}
}
int main()
{
int i=1;
rec(i);
}


Above Program show's the following output:





Share This:    Facebook Twitter

0 comments:

Post a Comment

If you have any doubts, please discuss here...