SINTAXIS GENERAL
/*Bienvenida*/
#include<iostream>
using namespace std;
int main () {
cout<<"hola mundo"<<endl;
return ø;
}
SINTAXIS IF
SINTAXIS IF
/*decicion*/
#include<iostream>
using namespace std;
int main () {
int a,b;
int a,b;
cout<<"ingrese primer numero"<<endl;
cin>> a;
cout<<"ingrese segundo numero"<<endl;
cin>> b;
if (a>b){
cout<<a<<"es mayor que"<<b<<endl;
}
else
cout<<b<<"es mayor que"<<a<<endl;
cin>> a;
cout<<"ingrese segundo numero"<<endl;
cin>> b;
if (a>b){
cout<<a<<"es mayor que"<<b<<endl;
}
else
cout<<b<<"es mayor que"<<a<<endl;
return ø;
}
SINTAXIS SWITCH
SINTAXIS SWITCH
/*switch*/
#include<iostream>
using namespace std;
int main () {
switch (color)
{
case 1:
cout
break
case 2:
cout
break
default;
cout
}
{
case 1:
cout
break
case 2:
cout
break
default;
cout
}
return ø;
}
No hay comentarios:
Publicar un comentario