basic programming and computer science topic description and discussion for students
bandicam 2017 01 23 20 38 45 832
Get link
Facebook
X
Pinterest
Email
Other Apps
This is just for your Knowledge.Those who want to start with java can find this Helpful.
Get link
Facebook
X
Pinterest
Email
Other Apps
Comments
Popular posts from this blog
Hello Everyone. Now Lets Talk about the very useful if-else statements. It is a very simple type of Selective Statement but is of great Use. A If statement is Generally used to Compare Standard Data Types like integer,char ,double,etc. which is put inside parenthesis, whose result is given in either true or false,or 0 or 1, and is then checked by the compiler, if it is true ,the statements following this if statement will execute ,Otherwise it will not execute if statement block and execute the else block if present. An else block is a Block that executes in case if statement is not satisfied. Now Coming to the example.It will be more clear when you see the Example. int n=5; if(n>2) { n++; n = 2*n; } else{ n--; n=2*n; } Here, We have Declared a integer type variable n with value 5. Then there is an if statement with test expression = n>2 . Since, n=5 ,i.e., n>2 , Therefore, this condition is true and satisfied. Therefore , if statement block will execu...
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; ...
Hello everyone.Now we will discuss the relational operators. Relational Operators are generally used to define a test expression or a test condition.These are > , < , >= , <= , == , != . Note that == operator is used to check equality whereas = operator is used for assignment.There are also logical operators such as !,&& and || to negate a condition or to combine two conditions. A comma operators is used to combine several expressions together which get executed from left to right.It works as a punctuator. Ternery Operator/Conditional Operator-It is the replacement of simple Conditional operator.Its Syntax is as follows:- (condition)?True:False; Now coming to the Datatype conversions.These are of two types:- 1.Implicit 2.Explicit Implicit-In Implicit type conversion the compiler converts one data type to another automatically and it actually converts all the data upto the type of largest operand available in the expression & that is why implicit...
Comments
Post a Comment