MY CART (5)

Use Coupon: CART20 and get 20% off on all online Study Material

ITEM
DETAILS
MRP
DISCOUNT
FINAL PRICE
Total Price: R

There are no items in this cart.
Continue Shopping
Menu
Nitin Gupta Grade: 11
        



Most Urgent C++ Problems --


Give definitions of the following : -


a)simple if


b)if..else


c)if..else..if


d)switch


Please give only and only definitions.No examples nothing else.



6 years ago

Answers : (2)

SAGAR SINGH - IIT DELHI
879 Points
										

Dear nitin,


  if ( TRUE ) Execute the next statement



if ( TRUE ) {

// Execute these statements if TRUE
}
else {
// Execute these statements if FALSE
}





if ( <condition> ) {

// Execute these statements if <condition> is TRUE
}
else if ( <another condition> ) {
// Execute these statements if <another condition> is TRUE and
// <condition> is FALSE
}

The switch statement provides a convenient alternative to the if when dealing with a multi-way branch. Suppose we have some integer value called test and want to do different operations depending on whether it has the value 1, 5 or any other value, then the switch statement could be employed:-
switch ( test ) {


case 1 :
// Process for test = 1
...
break;

case 5 :
// Process for test = 5
...
break;

default :
// Process for all other cases.
...

}

Please feel free to ask your queries here. We are all IITians and here to help you in your IIT JEE preparation.
All the best.
Win exciting gifts by answering the questions on Discussion Forum. So help discuss any query on askiitians forum and become an Elite Expert Leagueaskiitian.
Now you score 5+15 POINTS by uploading your Pic and Downloading the Askiitians Toolbar  respectively : Click here to download the toolbar..

Askiitians Expert
Sagar Singh
B.Tech, IIT Delhi 


















6 years ago
Nitin Gupta
16 Points
										

I got the definition of switch statement from your answer.But what can I write in the definition of simple if,if-else,if-else-if?There is no need to give examples.I know these things but just don't know the definition.


Thanks for you replies in this and other questions

6 years ago
Think You Can Provide A Better Answer ?
Answer & Earn Cool Goodies
  • Complete Physics Course - Class 12
  • OFFERED PRICE: R 2,600
  • View Details
  • Complete Physics Course - Class 11
  • OFFERED PRICE: R 2,800
  • View Details

Ask Experts

Have any Question? Ask Experts

Post Question

 
 
Answer ‘n’ Earn
Attractive Gift
Vouchers
To Win!!! Click Here for details