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
11
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

Mind Map 1
matt_daniells
10 Basic English Questions - Quiz 1
Leo JC
GCSE PE - 1
lydia_ward
IB Economics: International Trade
Han Zhang
Orwell and 1984
Polina Strich
OCR AS Biology
joshbrown3397
Anatomy and Physiology - BIO 111 - Test #1 Flashcards
ajudkins
Geography - Case Studies
jacobhatcher97
Roles of Education
Isobel Wagner
2.1.3 Software
Lavington ICT
PSBD TEST # 3_1_1
yog thapa