Posts

Showing posts from January, 2017

bandicam 2017 01 23 20 38 45 832

Image
This is just for your Knowledge.Those who want to start with java can find this Helpful.
Image
Hello Everyone!Now we will discuss about the switch statement. It is a kind of Selective Flow statement that tests the equality of a variable or expression with a list of Values,also called cases ,and execute the cases which satisfies the condition till there is a break or end of switch statement.There can also be a default case which executes when no other case matches with the variable.For example:- int main() { int n; cout<<"Enter Your Marks in C++ out of 10="; cin>>n; switch(n) {  case 10:cout<<"Grade=O";break;  case 9:cout<<"Grade=A+";break;  case 8:cout<<"Grade=A";break;  case 7:cout<<"Grade=B+";break;  case 6:cout<<"Grade=B";break;  case 5:cout<<"Grade=C";break;  case 4:cout<<"Grade=D";break;  case 3:  case 2:  case 1:cout<<"Grade=F";break; default:cout<<"Absent"; } return 0; } In the above...
Image
Hello Everyone.Sorry for a Long Delay. By the way,Now we are going to discuss about Flow of control(of a program). Flow of Control is a way in which a program is compiled and executed.It can be a bunch of statements Within braces ending with a semicolon or it can be selective or repetitive. Sequential Flow is as mentioned above a bunch of statements ending with semicolon within braces.For Example:- int main() { statement1; statement2; return 0; } Selective Flow includes if-else and switch statements which verifies a condition/text expression in order to execute the statements enclosed under it.The usage of if-else and switch statements is Shown in the Example.Example:- int main() { int a,b,c; cin>>a>>b; cout<<"\n1.Maximum\n2.Minimum\nEnter your Choice="; cin>>c; switch(c)//verify Condition { case 1:if(a>b)//text expression-Condition               cout<<a;     ...