0
Info
When you want to make a if loop then you need a variable (int...) ant the variable is in the () #include <iostream> Int main () { Int jear ; // variable cout << "Jear: " ; cin >> jear ; If ( jear == 2020) { cout << "Yes" ; } else { cout << "no" ; } }
2 Respostas
+ 4
Akos Szabo inorder for your code to run you have to add std:: infront each cout and infront of cin...
#include <iostream>
int main ()
{
int jear ; // variable
std::cout << "Jear: " ;
std::cin >> jear ;
if ( jear == 2020)
{
std::cout << "Yes" ;
}
else
{
std::cout << "no" ;
}
}
+ 3
So what's your question?