[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Control Instructions - Discussion

Home > C Programming > Control Instructions > MCQs Questions Discussion

9 / 33

Given the following C program, which one of the alternatives is correct?

main()
{
char status; 
int balance; 
balance = 1000;
status= (balance>= 1000)? 'C': 'O'
}

Astatus = 'O'

Bstatus= 'C'

Cstatus= O;

Dstatus = NIL

Answer: Option (Login/Signup)

Show Explanation

        return value1;

    else{
        return value2;

    }

so as per above logic the given ternary statement is converted as
    if(balance>=1000){

        return 'C';

    }else{

        return 'O';

    }    

Asked In :: Societe Generale

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here