top of page

EVALUACIÓN 6

(while)

#include<iostream>

#include <math.h>

using namespace std;

int main()

{

 int opcion;

 cout<<"MENU\n";

 cout<<" 1) Grados Celsius a Fahrenheit\n";

 cout<<" 2) Grados Celsius a Kelvin\n"; cout<<"**********************************************************************\n";

 cout<<"INGRESE UNA OPCION\n";

 cin>>opcion;

 switch(opcion)

 {

                case 1:  

                               {

                                               int C;

                                               double F;

                                               cout<<"Ingrese los grados celsius:  ";cin>>C;

                                               t=1;

                                               suma=0;

                                               while (C<0)

                                               {

                                                               F=(C*9/5)+32;

                                                               cout<<" Los grados en Fahrenheit son:  "<<F<<endl;

                                               }

                               };break;

               

               

                                case 2:

                               {

                                               int C1;

                                               double K;

                                               cout<<"Ingrese los grados celsius:  ";cin>>C1;

                                               do

                                               {

                                                               K=273.15+C1;

                                                              

                                               }while (C1<=10);

                                               cout<<" Los grados en Kelvin son:  "<<K<<endl;

                               };break;

               

               

               

                               

                              

               

 }

 

}

bottom of page