top of page

PROBLEMA ASIGNADO

SE MOSTRARA UN PROBLEMA ASIGNADO Y UNO DE OTRA FUENTE

1.- PROBLEMA

#include<iostream>
#include<cmath>
using namespace std;

int main ()
{
double a, b;  int c;

cout << "introdusca el primer numero" << endl ;
cin >> a;

cout << "introdusca el segundo numero" << endl;
cin >> b;

cout << "que operacion deseas hacer, 1(suma) , 2(producto)" << endl;
cin >> c;

switch (c)
{
   case 1:
   cout <<"el resultado es :" <<a+b<<endl;
   break;
   
   default :
   cout <<"el resultado es : " <<a*b<<endl;
   break;    
}
return 0 ;
}

2.- PROBLEMA

#include<iostream>

using namespace std;
main()

{int x,y;

cout<<"\n ingrese numero x:";
cin>>x;

cout<<"\n ingrese numero y:";
cin>>y;

if(x==y)

cout<<"\n Son iguales";

else

{

if(x>y)

cout<<"\n el mayor es:"<<x;

else

cout<<"\n el mayor es:"<<y;

}

return 0;

}

bottom of page