0% found this document useful (0 votes)
10 views2 pages

Cs 1

Uploaded by

Marvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Cs 1

Uploaded by

Marvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <iostream>

using namespace std;


int main(){

int age;
char gender;
cout<<"Enter your age: "; cin>>age;
if (age >=18){
cout<<"Enter your gender."; cin>>gender;
if (gender == 'M'|| gender == 'm'){
cout<<"Your color is Blue.";
}
else if (gender == 'F'|| gender == 'f'){
cout<<"Your color is Pink.";
}
else {
cout<<"Invalid Gender.";
}
}
else {
cout<<"You are too young.";
}
}
______________________________

#include <iostream>
using namespace std;
int main(){

int soldCookies;
cout<<"Enter the amount of sold cookies: "; cin>>soldCookies;
if (soldCookies >=20){
if (soldCookies < 30){
cout<<"Small Prize.";
}
else {
cout<<"Large Prize.";
}
}
else {
cout<<"No Prize.";
}

}
_________________________________________
#include <iostream>
using namespace std;
int main(){

int num;
cout<<"Enter number: "; cin>>num;

switch(num){
case 1: cout<<"One";
break;
case 2: cout<<"Two";
break;
case 3: cout<<"Three";
break;
default: cout<<"Invalid Number";
}

return 0;
}
________________________________________________

You might also like