| | |
NO output for if statments
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
why when I run it ....the output of the "if" statements doesn't come up ...Im trying to see if theres any erros but I just cant find anything please any help I would appreciated
C++ Syntax (Toggle Plain Text)
include <iostream> #include<iomanip> using namespace std; int main() { char size; cout<<"******************Welcome to M&D Pizza House*****************\n"; cout<<" What size pizza do you want ? (s = small; m = medium; l = large): "; cin>>size; if(size == 's' && size == 'S') cout<<" Size: Small"; else if (size == 'm' && size == 'M') cout<<" Size: Medium"; else if(size == 'l' && size == 'L') cout<<" Size: Large"; return 0; }
0
#2 20 Days Ago
Change the && to ||
I give up! 1) What word becomes shorter if you add a letter to it? [ Solved by : niek_e ] 2) What does this sequence equal to : (.5u - .5a)(.5u-.5b)(.5u-.5c) ... 3) What is the 123456789 prime numer? Ask4Answer
•
•
Join Date: Oct 2009
Posts: 7
Reputation:
Solved Threads: 3
0
#4 19 Days Ago
Hi,
Use "or" not "and" in if statement
Use "or" not "and" in if statement
C++ Syntax (Toggle Plain Text)
if(size == 's' || size == 'S')
•
•
Join Date: Oct 2009
Posts: 7
Reputation:
Solved Threads: 3
0
#5 19 Days Ago
C++ Syntax (Toggle Plain Text)
if(size == 's' || size == 'S') cout<<" Size: Small"; else if (size == 'm' || size == 'M') cout<<" Size: Medium"; else if(size == 'l' || size == 'L') cout<<" Size: Large";
Last edited by alg; 19 Days Ago at 5:24 am.
![]() |
Similar Threads
- reading and manipulating console output (C++)
- how to use regex or an array to display some output from an arithmetic input? (VB.NET)
- Capturing Console Output (C)
- Why am I getting this output (C++)
- Help With SQL Server Agent (MS SQL)
- letter and word counter (C)
- Application Output Help (Java)
Other Threads in the C++ Forum
- Previous Thread: Queue/ Stack problem
- Next Thread: Helpnwith linked lists
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node output parameter pointer problem program programming project proxy python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






