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

Chemistry 3 Extracting Metals Core GCSE
Chloe Roberts
Cognitive Psychology Key Terms
Veleka Georgieva
Metallic bonding
anna.a.graysmith
Biology AS Level UNIT 1
Valentin Andrei
AQA Business Unit 1
lauren_binney
Business Studies - AQA - GCSE - Types of Ownership
Josh Anderson
Continents & Oceans
Thomas Yoachim
a christmas carol
maha.als10
GCSE AQA Chemistry 2 Salts & Electrolysis
Lilac Potato
2PR101 1.test - Doplňující otázky
Nikola Truong
Health and Safety at Work Act 1974 (HASWA)
Carina Storm