ESTE ES UN PROGRAMA QUE SUMA LA SERIE 100+90+80+70+60+50.....HASTA LLEGAR A 0.
ESTA REALIZADO EN LENGUAJE C++.
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main (void)
{
int s,j=5,x=0;
textcolor(1);
textbackground(8);
clrscr();
gotoxy(16,2);printf(" SUMA DE LA SERIE DE 100 HASTA 0");
gotoxy(22,4);cout<<" sumar la siguiente serie ";
for(s=100;s>=0;s=s-10)
{
j=j+5;
gotoxy(j,8);cout<<s<<" + ";gotoxy(62,8);cout<<" ";
x=x+s;
}
gotoxy(8,10);cout<<" la suma de la serie es : "<<x;
getch();
}
ESTA REALIZADO EN LENGUAJE C++.
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main (void)
{
int s,j=5,x=0;
textcolor(1);
textbackground(8);
clrscr();
gotoxy(16,2);printf(" SUMA DE LA SERIE DE 100 HASTA 0");
gotoxy(22,4);cout<<" sumar la siguiente serie ";
for(s=100;s>=0;s=s-10)
{
j=j+5;
gotoxy(j,8);cout<<s<<" + ";gotoxy(62,8);cout<<" ";
x=x+s;
}
gotoxy(8,10);cout<<" la suma de la serie es : "<<x;
getch();
}
No hay comentarios:
Publicar un comentario