Discussion :: Control Instructions - Find Output of Program (Q.No.2)
|K.Suriya said: (May 14, 2011)|
|Printf statenment contains one if condition with true block and else block a>10 means if (a>10) the condition is false so the else statement will execute print the str value is c_program.|
|Rani said: (Feb 15, 2012)|
|What about "Ps"?|
|Biswajit said: (Mar 29, 2012)|
|"ps" is nothing but it will print if the condition (a>10).|
|Sravanthi Reddy said: (Aug 29, 2014)|
We get ps as a output only when the condition a>10 is satisfies but acc to the given data the condition is failed so pn is not an output.
|Priyatharshini said: (Oct 16, 2014)|
|This is an ternary or conditional operator that's why it execute exp2 in this operator.
If the given condition is true exp1 will execute else exp 2 will execute here the condition is (a>10) but the value of a is 5.
So the given condition is false that's the answer will be printed as c-language.
|Y Saikrishna said: (Nov 6, 2014)|
|I didn't understand the above can anyone help me in brief.|
|Yashwanth said: (Feb 5, 2016)|
|Sorry but I did not get any of above explanation because as there is no value assigned to ps how it comes to role here.|
|Shubham said: (Nov 13, 2016)|
|Conditonal statement is used in printf func nothing logic is used.|
|Biswabhusan Dixit said: (Jun 30, 2019)|
Here is the use of conditionl operator .The syntax for conditional operator is :
If the condition will be true then the 1st statement is executed and for false statement2.
so, here condition false so the 2nd statement will be that means pintf("%s",str); will be remaining for str print c-programming.
That's all thanks.
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.