Show some effort, and learn to use code tags.
Take out the system PAUSE, only beginners do that.
Test your while loop, doesn't look like it works, can't give a line number without code tags.
I recommend write the menu and then the program....
#include<iostream>
usingnamespace std;
int main()
{
int x;
cout<<"Input a number"<<endl;
cin>>x;
while(x < 1 || x > 12){
cout << "Enter 1-12: ";
cin >> x;
}
if(x == 1){
cout<<"January is Winter"<<endl;
cout<<"HAPPY NEW YEAR"<<endl;
}
elseif(x == 2){
cout<<"Febuary is WINTER"<<endl;
cout<<"Happy Valentine's Day"<<endl;
}
elseif(x == 3){
cout<<"March is SPRING"<<endl;
cout<<"Congratulations, Graduates!"<<endl;
}
elseif(x == 4){
cout<<"April is SPRING"<<endl;
}
elseif(x == 5){
cout<<"May is SPRING"<<endl;
}
elseif(x == 6){
cout<<"June is SUMMER"<<endl;
}
elseif(x == 7){
cout<<"July is SUMMER"<<endl;
}
elseif(x == 8){
cout<<"August is SUMMER"<<endl;
}
elseif(x == 9){
cout<<"September is FALL"<<endl;
}
elseif(x == 10){
cout<<"October is FALL"<<endl;
}
elseif(x == 11){
cout<<"November is FALL"<<endl;
}
elseif(x == 12){
cout<<"December is WINTER"<<endl;
}
return 0;
}
This is The Bingo
#include<iostream>
usingnamespace std;
int main()
{
int x;
cout<<"Input a number"<<endl;
cin>>x;
switch(x)
{
case 1:
cout<<"That is Letter B"<<endl;
break;
case 2:
cout<<"That is Letter B"<<endl;
break;
case 3:
cout<<"That is Letter B"<<endl;
break;
case 4:
cout<<"That is Letter B"<<endl;
break;
case 5:
cout<<"That is Letter B"<<endl;
break;
case 6:
cout<<"That is Letter B"<<endl;
break;
case 7:
cout<<"That is Letter B"<<endl;
break;
case 8:
cout<<"That is Letter B"<<endl;
break;
case 9:
cout<<"That is Letter B"<<endl;
break;
case 10:
cout<<"That is Letter B"<<endl;
break;
case 11:
cout<<"That is Letter B"<<endl;
break;
case 12:
cout<<"That is Letter B"<<endl;
break;
case 13:
cout<<"That is Letter B"<<endl;
break;
case 14:
cout<<"That is Letter B"<<endl;
break;
case15:
cout<<"That is Letter B"<<endl;
break;
case 16:
cout<<"That is Letter I"<<endl;
break;
case 17:
cout<<"That is Letter I"<<endl;
break;
case 18:
cout<<"That is Letter I"<<endl;
break;
case 19:
cout<<"That is Letter I"<<endl;
break;
case 20:
cout<<"That is Letter I"<<endl;
break;
case 21:
cout<<"That is Letter I"<<endl;
break;
case 22:
cout<<"That is Letter I"<<endl;
break;
case 23:
cout<<"That is Letter I"<<endl;
break;
case 24:
cout<<"That is Letter I"<<endl;
break;
case 25:
cout<<"That is Letter I"<<endl;
break;
case 26:
cout<<"That is Letter I"<<endl;
break;
case 27:
cout<<"That is Letter I"<<endl;
break;
case 28:
cout<<"That is Letter I"<<endl;
break;
case 29:
cout<<"That is Letter I"<<endl;
break;
case 30:
cout<<"That is Letter I"<<endl;
break;
case 31:
cout<<"That is Letter N"<<endl;
break;
case 32:
cout<<"That is Letter N"<<endl;
break;
case 33:
cout<<"That is Letter N"<<endl;
break;
case 34:
cout<<"That is Letter N"<<endl;
break;
case 35:
cout<<"That is Letter N"<<endl;
break;
case 37:
cout<<"That is Letter N"<<endl;
break;
case 38:
cout<<"That is Letter N"<<endl;
break;
case 39:
cout<<"That is Letter N"<<endl;
break;
case 40:
cout<<"That is Letter N"<<endl;
break;
case 41:
cout<<"That is Letter N"<<endl;
break;
case 42:
cout<<"That is Letter N"<<endl;
break;
case 43:
cout<<"That is Letter N"<<endl;
break;
case 44:
cout<<"That is Letter N"<<endl;
break;
case 45:
cout<<"That is Letter N"<<endl;
break;
case 46:
cout<<"That is Letter G"<<endl;
break;
case 47:
cout<<"That is Letter G"<<endl;
break;
case 48:
cout<<"That is Letter G"<<endl;
break;
case 49:
cout<<"That is Letter G"<<endl;
break;
case 50:
cout<<"That is Letter G"<<endl;
break;
case 51:
cout<<"That is Letter G"<<endl;
break;
case 52:
cout<<"That is Letter G"<<endl;
break;
case 53:
cout<<"That is Letter G"<<endl;
break;
case 54:
cout<<"That is Letter G"<<endl;
break;
case 55:
cout<<"That is Letter G"<<endl;
break;
case 56:
cout<<"That is Letter G"<<endl;
break;
case 57:
cout<<"That is Letter G"<<endl;
break;
case 58:
cout<<"That is Letter G"<<endl;
break;
case 59:
cout<<"That is Letter G"<<endl;
break;
case 60:
cout<<"That is Letter G"<<endl;
break;
case 61:
cout<<"That is Letter O"<<endl;
break;
case 62:
cout<<"That is Letter O"<<endl;
break;
case 63:
cout<<"That is Letter O"<<endl;
break;
case 64:
cout<<"That is Letter O"<<endl;
break;
case 65:
cout<<"That is Letter O"<<endl;
break;
case 66:
cout<<"That is Letter O"<<endl;
break;
case 67:
cout<<"That is Letter O"<<endl;
break;
case 68:
cout<<"That is Letter O"<<endl;
break;
case 69:
cout<<"That is Letter O"<<endl;
break;
case 70:
cout<<"That is Letter O"<<endl;
break;
case 71:
cout<<"That is Letter O"<<endl;
break;
case 72:
cout<<"That is Letter O"<<endl;
break;
case 73:
cout<<"That is Letter O"<<endl;
break;
case 74:
cout<<"That is Letter O"<<endl;
break;
case 75:
cout<<"That is Letter O"<<endl;
break;
default:
cout<<"Exit"<<endl;
}
system("PAUSE");
return 0;
}
This is the My loop
#include <iostream>
usingnamespace std;
int main()
{
int num = 0;
float input = 0, sum = 0;
while (input != -1)
{
cout<<"Input a number No 1:"<<endl;
cin >> input;
cout<<"Input a number No 2:"<<endl;
cin>> input;
cout<<"Input a number No 3:"<<endl;
cin>> input;
if( input !=1 )
{
num++;
sum += input;
cout << " The Sum is: " << sum+input<< endl;
cout << " The Average is: " << sum/num << endl;
}
}
return 0;
}
Duplicate post. Please don't do this, it is ultimately a time waster.
Also, what do take main() to mean ?
If you use a modulus expression, you could do the BINGO thing with 5 LOC
These are the compile errors I get when using the gear icon on the top right of the code:
59:1: error: 'This' does not name a type In function 'int main()':
63:5: error: redefinition of 'int main()'
4:5: note: 'int main()' previously defined here
113:1: warning: label 'case15' defined but not used [-Wunused-label] At global scope:
301:1: error: 'This' does not name a type In function 'int main()':
306:5: error: redefinition of 'int main()'
4:5: note: 'int main()' previously defined here
This should have been your job: If you have compile errors, then post them here.
Have a read of the tutorial at the top left of this page. Look up the things I mentioned in the reference.
We're really sorry too. We don't mean to be harsh. You shouldn't be expected to know everything. For now on, however, it would be really nice if you just try to type
[ c o d e ]
~ copy and paste your code here~
[ / c o d e ]
before you post. It makes it easier for us to quickly skim your code.