Calculadora

391 views
324 views

Published on

No sean webones y le cambian los colores

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
391
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Calculadora

  1. 1. # include <conio.h># include <iostream.h># include <stdio.h># include <stdlib.h># include <dos.h># include <math.h> void main() { float num1, num2, multi, divi, suma, resta, ex, ra; int pregunta, i=1, op, num3, num4; clrscr(); while (pregunta!=7) { clrscr(); textcolor(119); gotoxy(9,5);cprintf("_____________________CALCULADORA_____________________"); textcolor(7); gotoxy(9,6); cprintf("--"); gotoxy(9,7); cprintf("--"); gotoxy(9,8); cprintf("--"); gotoxy(9,9); cprintf("--"); gotoxy(9,10); cprintf("--"); gotoxy(9,11); cprintf("--"); gotoxy(9,12); cprintf("--"); gotoxy(9,13); cprintf("--"); gotoxy(9,14); cprintf("--"); gotoxy(9,15); cprintf("--"); gotoxy(9,16); cprintf("--"); gotoxy(9,17); cprintf("--");
  2. 2. gotoxy(9,18); cprintf("--"); gotoxy(9,19); cprintf("--"); gotoxy(9,20); cprintf("--"); gotoxy(9,21);cprintf("_____________________________________________________"); textcolor(11); gotoxy(12,8); cprintf("¿Que desea hacer?"); textcolor(5); delay(50); gotoxy(14,10); cprintf("[1=suma]"); delay(100); gotoxy(21,11); cprintf("[2=resta]"); delay(115); gotoxy(29,12); cprintf("[3=multiplicacion]"); delay(120); gotoxy(14,13); cprintf("[4=division]"); delay(125); gotoxy(26,14); cprintf("[5=exponente]"); delay(130); gotoxy(38,15); cprintf("[6=raiz]"); delay(140); gotoxy(13,16); cprintf("[7=salir]"); textcolor(9); delay(130); gotoxy(15,18); cprintf("[ ]"); gotoxy(17,18); cin>>pregunta; if(pregunta>7) { clrscr(); textcolor(14); delay(1000); gotoxy(10,5); cprintf("?//?//??/ERROR NO SEA TONTOSOLO HAY 4 OPCIONES?//?//??//?"); delay(2000); gotoxy(10,10); cprintf("?//?//??/ERROR NO SEA TONTOSOLO HAY 4 OPCIONES?//?//??//?"); delay(1000); gotoxy(10,15); cprintf("?//?//??/ERROR NO SEA TONTOSOLO HAY 4 OPCIONES?//?//??//?n"); }
  3. 3. if(pregunta==1){do{clrscr();textcolor(11);gotoxy(9,3); cprintf("__________________________________");textcolor(3);gotoxy(10,5); cprintf("Ingrese primer numero [ ]");gotoxy(33,5); cin>>num1;gotoxy(10,6); cprintf("Ingrese segundo numero [ ]");gotoxy(9,8); cprintf("__________________________________");gotoxy(34,6); cin>>num2;textcolor(11);suma= num1+num2;textcolor(3);clrscr();textcolor(8);gotoxy(7,9); cprintf("La suma es...| n") ;gotoxy(21,9); cout<<suma;textcolor(11);gotoxy(10,19); cout<<"Desea hacer otra suma 1=si 2=no [ ]";gotoxy(44,19); cin>>op;}while(op==1);}if(pregunta==2){do{clrscr();textcolor(11);gotoxy(9,3); cprintf("__________________________________");textcolor(3);gotoxy(10,5); cprintf("Ingrese primer numero [ ]");gotoxy(33,5); cin>>num1;gotoxy(10,6); cprintf("Ingrese segundo numero [ ]");gotoxy(9,8); cprintf("__________________________________");gotoxy(34,6); cin>>num2;
  4. 4. clrscr(); textcolor(8); resta=num1-num2; gotoxy(7,9); cprintf("La resta es| n"); gotoxy(19,9); cout<<resta; textcolor(11); gotoxy(10,19); cout<<"Desea hacer otra resta 1=si 2=no [ ]"; gotoxy(45,19); cin>>op; }while(op==1); } if(pregunta==3) { do{ clrscr(); textcolor(11); gotoxy(9,3); cprintf("__________________________________"); textcolor(3); gotoxy(10,5); cprintf("Ingrese primer numero [ ]"); gotoxy(33,5); cin>>num1; gotoxy(10,6); cprintf("Ingrese segundo numero [ ]"); gotoxy(9,8); cprintf("__________________________________"); gotoxy(34,6); cin>>num2;multi=num1*num2; clrscr(); textcolor(8); gotoxy(7,9); cprintf("La multiplicacion es: "); gotoxy(29,9); cout<<multi; textcolor(11); gotoxy(10,19); cout<<"Desea hacer otra multiplicacion 1=si 2=no []"; gotoxy(54,19); cin>>op; }while(op==1); }
  5. 5. if(pregunta==4){do{clrscr();textcolor(11);gotoxy(9,3); cprintf("__________________________________");textcolor(3);gotoxy(10,5); cprintf("Ingrese primer numero [ ]");gotoxy(33,5); cin>>num1;gotoxy(10,6); cprintf("Ingrese segundo numero [ ]");gotoxy(9,8); cprintf("__________________________________");gotoxy(34,6); cin>>num2;divi=num1/num2;clrscr();textcolor(8);gotoxy(7,9); cprintf("La division es: ");gotoxy(23,9); cout<<divi;textcolor(11);gotoxy(10,19); cout<<"Desea hacer otra division 1=si 2=no [ ]";gotoxy(47,19); cin>>op;}while(op==1);}if(pregunta==5){do{clrscr();textcolor(11);gotoxy(9,3); cprintf("__________________________________");textcolor(3);gotoxy(10,5); cprintf("Ingrese base [ ]");
  6. 6. gotoxy(24,5); cin>>num3;gotoxy(10,6); cprintf("Ingrese exponente [ ]");gotoxy(9,8); cprintf("__________________________________");gotoxy(29,6); cin>>num4;//ex= num3^num4;ex=pow(num3,num4);clrscr();textcolor(8);gotoxy(7,9); cprintf("La respuesta es: ");gotoxy(24,9); cout<<ex;textcolor(11);gotoxy(10,19); cout<<"Desea elevar otro numero 1=si 2=no [ ]";gotoxy(47,19); cin>>op;}while(op==1);}if(pregunta==6){do{clrscr();textcolor(11);gotoxy(9,3); cprintf("__________________________________");textcolor(3);gotoxy(10,5); cprintf("Ingrese el numero [ ]");gotoxy(30,5); cin>>num1;ra=sqrt(num1);clrscr();textcolor(8);gotoxy(7,9); cprintf("La raiz cuadrada es: ");gotoxy(27,9); cout<<ra;textcolor(11);
  7. 7. gotoxy(10,19); cout<<"Desea sacar otra raiz cuadrada 1=si 2=no []"; gotoxy(53,19); cin>>op; }while(op==1); } } }

×