#include<stdio.h>
int square(int f)
{
static int count=0;
count++;
printf("%d ",count);
if(f==1||(count==f))
return f;
else
return (f+square(f));
}
void main()
{
int n=4;
int j=square(n);
printf("square=%d",j);
}
output
square=16
int square(int f)
{
static int count=0;
count++;
printf("%d ",count);
if(f==1||(count==f))
return f;
else
return (f+square(f));
}
void main()
{
int n=4;
int j=square(n);
printf("square=%d",j);
}
output
square=16
No comments:
Post a Comment