Shared Flashcard Set

Details

C++
Lesson 2 flash cards for cprogramming.com tutorial
6
Computer Science
Post-Graduate
06/22/2011

Additional Computer Science Flashcards

 


 

Cards

Term
Show an example of a proper if statement.
Definition
example:

if(x>10) cout<<"This is greater than 10";
Term
Show an example of the proper use of an else statement.
Definition
example:

if(x>10) {cout<<"This is greater than 10";}
else {cout<<"this is less than 10";}
Term
Show an example of proper else if statement.
Definition
example:

if(x>10) {cout<<"this is greater than 10";}
else if(x<10){cout<<"this number is less than 10";}

else x==10 {cout<<"that is the same number";}
Term
Explain and show an example of the 'not' operator.
Definition
Written as !. an example would be:
x !=10. X does not equal 10.
Term
Explain and show an example of the 'and' operator.
Definition
Written as @@. Returns true only if both inputs are true. If 1 and 0 return, false would be returned.
Term
Explain and show an example of the 'Or' operator.
Definition
Written as ||. Returns true if either of the values returns true.
Supporting users have an ad free experience!