Print the series upto 'n' terms: 1 4 27 256.......

c-techaravind


                                              To compile and execute the program, copy the code into a text file. Save the text file with the extinction .c (ex. program.c). Save your file in turboc2 or borland (it may your othe c-compiler). Now open you IDE (tc.exe) , goto file->pick file. Your source file will be loaded into IDE. Now you can compile and run the file easily.






#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,i,p;
clrscr();
gotoxy(31,1);
printf("1-4-27 series");
gotoxy(26,3);
printf("http:\\techaravind.blogsopt.com");
gotoxy(1,5);
printf("Enter no. of elements:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
p=pow(i,i);
printf("%d",p);
printf(" ");

}
getch();
}

0 comments:

Post a Comment

 
Etutos © 2010-2011