#include<stdio.h>
#include<conio.h>
int jumlah(int n)
{
if(n==1)return 1;
else return (n*n)+jumlah(n-1);
}
void main()
{
int n,i;
printf("n= ");
scanf("%d",&n);
i=jumlah(n);
printf("%d jumlah= %d",n,i);
getch();
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment