IF/Else

Description

IF/Else
claudio torres
Quiz by claudio torres, updated more than 1 year ago
claudio torres
Created by claudio torres over 5 years ago
9
0

Resource summary

Question 1

Question
¿Para que sirve un if/ else en C++?
Answer
  • Sirve para la entrada de datos
  • Sirve para la salidade datos
  • Sirve realizar decisiones simples en el flujo del programa
  • Sirve para insertar archivos

Question 2

Question
¿Que va primero in if o else?
Answer
  • If
  • else

Question 3

Question
¿Como complementarias este programa para saber si es hombre o mujer con if? #include<iostream> #include<stdlib.h> using namespace std; int main(){ int varable; cout<<"Que eres hombre o mujer?"<<endl; cout<<"Escribe 1 si eres hombre"<<endl; cout<<"Escribe 2 si eres mujer"<<endl; cin>>variable;
Answer
  • if(variable==1){ cout<<"OK ERES HOMBRE"<<endl; }else if(vaieable==2){ cout<<"OK ERES MUJER"<<endl; }
  • if(variable=1){ cout<<"OK ERES HOMBRE"<<endl; }else if(vaieable=2){ cout<<"OK ERES MUJER"<<endl; }
  • if(variable==1){ cout<<"OK ERES HOMBRE"<<endl; if(vaieable==2){ cout<<"OK ERES MUJER"<<endl; } }
  • (variable==1){ cout<<"OK ERES HOMBRE"<<endl; }else (vaieable==2){ cout<<"OK ERES MUJER"<<endl; } }

Question 4

Question
¿Es un ciclo if/else?
Answer
  • Si
  • No

Question 5

Question
¿Que librerías se necesita para usar if/else en C++?
Answer
  • #include<iostream>
  • #include<stdlib.h>
  • Ninguna, el IDE ya los incluye
  • #include<math.h>
Show full summary Hide full summary

Similar

Constitutional Law
jesusreyes88
Models For Explaining Human Memory
Matthew Li
What was the Cold War?
Emily Tisch
unit 1 f321 chemistry ocr
methmip
GCSE Biology Unit 1 AQA
Archie Clay
Edexcel Additional Science Chemistry Topics 1+2
El Smith
NSI Test First day
brahim matrix
Java Practice 1
Ummm No
World War I
Lydia Klein
10 Ways to Improve Your Productivity
Rebecca Tarpey
NSI Course
Yuvraj Sunar