===========================================================================
CODING
#include<all.h>
void main()
{
clrscr();
int i,n,N,sum;
textcolor(RED+BLINK);
gotoxy(32,1);
cprintf("HELLO WORLD!!!!");
textcolor(BLUE+BLINK);
gotoxy(1,2);
cprintf("--------------------------------SUM OF SERIES-----------------------------------");
textcolor(YELLOW+BLINK);
gotoxy(10,4);
cprintf("Enter number: ");
cscanf("%d",&n);
textcolor(GREEN+BLINK);
gotoxy(10,6);
for(i=1,N=0,sum=0;i<=n;i++)
{
N=i;
sum=i*i+sum;
if(N<=n-1)
cprintf("%dý + ",N);
else if(N==n)
cprintf("%dý = ",N);
}
cprintf("%d",sum);
getch();
getch();
}
CODING
#include<all.h>
void main()
{
clrscr();
int i,n,N,sum;
textcolor(RED+BLINK);
gotoxy(32,1);
cprintf("HELLO WORLD!!!!");
textcolor(BLUE+BLINK);
gotoxy(1,2);
cprintf("--------------------------------SUM OF SERIES-----------------------------------");
textcolor(YELLOW+BLINK);
gotoxy(10,4);
cprintf("Enter number: ");
cscanf("%d",&n);
textcolor(GREEN+BLINK);
gotoxy(10,6);
for(i=1,N=0,sum=0;i<=n;i++)
{
N=i;
sum=i*i+sum;
if(N<=n-1)
cprintf("%dý + ",N);
else if(N==n)
cprintf("%dý = ",N);
}
cprintf("%d",sum);
getch();
getch();
}
===========================================================================
No comments:
Post a Comment