Saturday 16 September 2017

Nested If-else : To find the roots of quadratic equation ax2+bx+c=0 and a!=0



let ax2+bx+c=0: is a quadratic equation
output:
            Enter the values of a,b,c : 1 -5 6
            roots are x1=3  x3= 2


In the above program, a,b,c are the coefficient of quadratic equation. We calculate the discriminant d=b2-4ac. Then using nested if-else statement.

for any queries comment below:


Friday 8 September 2017

If-else-If Ladder : Program to calculate the division of a student according to marks obtained



output :
       enter marks in 3 subjects : 90 60 30
       first division

In the above program we can also use if statement in the place of else if . But the time to execute the program is increased.In if statement every condition is checked whether it's true or false. In case of else if : if condition is true then exit, if false then going to check next condition.

for any other queries comment below: 

Wednesday 6 September 2017

C++ Program to calculate the greatest of three numbers using nested if-else


In the above program, the user entered the values of three numbers a,b&c. First condition is checked (a>b). If this condition is true then comes to condition (a>c). If condition (a>c) is true then first number __ is greatest is print otherwise third number __ is greatest is print.

But if the condition (a>b) is false then it checks for the condition (b>c) . If condition (b>c) is true then second number __ is greatest is print otherwise third number __ is greatest is print.


for any other queries comment below....

Tuesday 5 September 2017

C++ Program to check whether a number is even or odd


In this program, we first enter a number (say 10). Then check the condition (10%2). If it gives result zero(0), then then it prints the message number is even and if it is non zero(0),then it prints the message number is odd.


for any other queries comment below....

Monday 4 September 2017

second program c++ : All arithmetic operatioall





You can use cin to input form the user on runtime
syntax of cin already in the comment of a program


for any other queries comment below or mail me your queries
subject of mail be:
subject : query blog c&c++ 
then text your query

email: aassasingh410@gmail.com


second program c : All arithmetic operations


c progran of all arithmetic operations
for any queries comment below

Sunday 3 September 2017

First program : How to print 'hello world' c&c++

c program 


next<<

c++ program 

// is used for single line comment
/*---------*/is used for multiple line comment 



Nested If-else : To find the roots of quadratic equation ax2+bx+c=0 and a!=0

let ax 2 +bx+c=0 : is a quadratic equation output:             Enter the values of a,b,c : 1 -5 6             roots are x1=3  x3=...