BORLAND C++
Usaremos las librerias comunes
#include <iostream.h>
#include <conio.h>
La variable es “int A,B,C”
Inicio
Main( )
{
limpiar pantalla
clrscr( );
Desarrollo
Pausa
getch ( );
return(0);
}
Elabore un algoritmo que permita calcular la suma, multiplicacion,resta, y division
Datos
Suma
Multiplicacion
Resta
Division
#include <iostream.h>
#Include <conio.h>
Int N1,N2,suma,resta,multiplicacion ;
Float Division;
Main ( )
{
Clrscr( );
cout<<“escriba N1”;
Cin>> N1;
Cout<<“escriba N2”;
Cin>>N2;
Suma=N1+N2;
Resta=N1-N2;
Multiplicacion=N1*N2;
Division=N1/N2;
Cout<<“la suma total es”<<suma;
Cout<<“la resta total es“<<resta;
Cout<<“la multiplicacion total es”<<multiplicacion;
Cout<<“la division total es”<<division;
getch ( );
Return (0);
}
fin
Elabore un algoritmo que permita realizar la suma de 3 edades
Datos
Edad 1=?
Edad 2=?
Edad 3=?
#Include<iostream.h>
#Include<conio.h>
Int Edad ;
Main( )
{
Clrscr( )
Cout<<“ingrese edad 1”;
Cin>> edad 1;
Cout<<“ingrese edad 2”;
Cin>> edad 2;
Cout<<“ingrese edad 3”;
Cin>> edad 3;
Suma=edad 1,edad 2,edad 3;
Cout <<“ la suma de las edades es”<<suma;
getch ( );
return (0);
}
fin
Elabore un algoritmo que permita calcular el promedio de 4 notas
Datos
Nota 1
Nota 2
Nota 3
Nota 4
#include<iostream.h>
#include<conio.h>
Int nota 1,nota 2,nota 3,nota 4,suma;
fload promedio;
Main ( )
}
Clrscr( );
Cout<<“ingrese nota 1”;
Cin>>nota 1;
Cout<<ingrese nota 2”;
Cin>>nota 2;
Cout<<ingrese nota 3”;
Cin>>nota 3;
Cout<<“ingrese nota 4”;
Cin>>nota 4;
Suma=nota 1 + nota 2 + nota 3 + nota 4;
Promedio=suma/4;
cout<<“el promedio es”;
Cout<<promedio;
getch( );
return(0);
}
fin