martes, 30 de septiembre de 2014

USOS DE IF EN C++

#include
#include
#include
main(){
double nota;
cout<>nota;
if(nota<5)
cout<<"Suspenso";
else cout<=6 && nota<=9)
cout<<"Notable";
else cout<<"Excelente";
getch(); return 0;
}
#include
#include
using namespace std;
int main()
{
int n;
cout<<"ingrese nota"<>n;
if (n<5){
cout<<"suspenso"<<endl;
}
else{
cout<<"aprobado"<<endl;
}
getch ();
return 0;
}


#include
#include
#include
using namespace std;
int main(){
double nota;
cout< “;
cin>>nota;
if (nota<5)
cout<<"SUSPENSO";
else
if (nota<=6)
cout<<"BIEN";
else
if (nota<=9)
cout<<"NOTABLE";
else
cout<<"SOBRESALIENTE";

getch();
}

No hay comentarios:

Publicar un comentario