Академический Документы
Профессиональный Документы
Культура Документы
Pgina de inicio Todas las categoras Arte y Humanidades Automviles y Transport Belleza y Estilo Ciencias sociales Ciencias y Matemticas Comer y Beber Computadoras e Intern Deportes Educacin y Formacin Ms Internacional Acerca de
Siguiente
mi maestro de programacion me dijo que me exentaba en el semestre si podia hacer una calculadora en el compilador turbo c. el ya me habia desafiado una vez y si lo pude hacer pero esto ya esta un poco mas dificil ya que todavia me estoy iniciando en este lenguaje de programacion. necesito que me ayuden para exentar y dejar a mi maestro con el ojo cuadrado!!!!! le pondre todos los puntos a quien me responda
Ads
Netflix Series Online www.netflix.com/SeriesOnline Mira Series Online Gratis Sin Descargar. Ac! Delphi DataMatrix barcode barcode-software.eu/studio full source Delphi/C++Builder Ean/UPC/PDF417,Code128...
Hoy en Yahoo
El traje de bao le juega una mala pasada a Sofa Vergara
Mejor respuesta
Mario Cueva respondida hace 6 aos /* Este fichero ha sido descargado desde: http://www.elrincondelc.com * calc.c: Lame-brain Calculator * * For simplicity in parsing, this program * reads lines of the form: * * value operation * * where the value is optional in some cases. * For example, the following script computes * the integer part of sqrt(1 + 3.4*3.4): * * 3.4 = * 3.4 * *1+ * sqrt * floor */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <ctype.h> #include <errno.h> #define LINSIZ 40 char *getline(char *); main() { double reg = 0.0; char line[LINSIZ]; while (getline(line) != NULL) { char *op;
La actriz de 'Modern Family' paraliz las playas australianas aunque su bikini no la favoreci mucho.
Descubrir preguntas
Como pegar una foto chica en una imagen grande en Photoshop Cs5? Barra Tipo Rocketdock? Me dicen algunos libro para aprender a programar? por que miercoles no puedo responder a las preguntas de yahoo?
Condiciones
Privacidad
AdChoices
RSS
http://espanol.answers.yahoo.com/question/index?qid=20071109065317AAyhOMZ
1/4
24/2/2014
double val;
/* Parse command string */ val = strtod(line,&op); while (isspace(*op)) ++op; strupr(op); /* Perform operation */ errno = 0; if (*op == '+') reg += val; else if (*op == '-') reg -= val; else if (*op == '*') reg *= val; else if (*op == '/') { if (val != 0) reg /= val; else { puts("ERROR>>> invalid divisor"); continue; } } else if (*op == '=') reg = val; else if (*op == '^') { if (val == 0.0) reg = 1.0; else if (val == 0.5) reg = sqrt(reg); else reg = pow(reg,val); } else if (strncmp(op,"NEGATE",1) == 0) reg = -reg; else if (strncmp(op,"MOD",1) == 0) { if (val == 0.0) { puts("ERROR>>> invalid modulus"); continue; } else reg = fmod(reg,val); } else if (strncmp(op,"CEIL",1) == 0) reg = ceil(reg); else if (strncmp(op,"FLOOR",1) == 0) reg = floor(reg); else if (strncmp(op,"ROUND",1) == 0) reg = (reg < 0.0) ? ceil(reg - 0.5) : floor(reg + 0.5); else if (strncmp(op,"SQRT",1) == 0) reg = sqrt(reg); else if (strncmp(op,"QUIT",1) == 0) exit(0); else if (*op != '\0') { puts("ERROR>>> invalid operation"); continue; } if (errno) perror("ERROR>>>"); else printf("\t%s => %g\n",line,reg); } return 0; } char *getline(char *buf) { fputs("Calc> ",stdout); fflush(stdout); return gets(buf); } /* Output: Calc> 3.4 =
http://espanol.answers.yahoo.com/question/index?qid=20071109065317AAyhOMZ
2/4
24/2/2014
http://espanol.answers.yahoo.com/question/index?qid=20071109065317AAyhOMZ
3/4
24/2/2014
Ms antigua
Edgar T respondida hace 6 aos Parece que no buscaste mucho... Aqui esta: http://www.lawebdelprogramador.com/codig... Saludos 1 Comentario
http://espanol.answers.yahoo.com/question/index?qid=20071109065317AAyhOMZ
4/4