[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 :: Variables & Data Types - Discussion

Home > C Programming > Variables & Data Types > MCQs Questions Discussion

1 / 51

What will be output of the following "c" code?

#include<stdio.h>
int main()
{
float i, j;
scanf(%f  %f, &i, &j);
printf(%.2f %.3f, i, j);
return 0;
}

What will be the output for the give input 12.342 and 123.4568

A12.34 123.456

B12.342 123.4568

C12 123

DCompilation Error

ENone of these

Answer: Option (Login/Signup)

Show Explanation

I see couple of issues with question.



1. there should be compliation issue with this statement - printf(%.2f %.3f, i, j);



I have tried to complie 



$ gcc -o q8 q8.c

q8.c: In function ‘main’:

q8.c:6:8: error: expected expression before ‘%’ token

  scanf(%f %f,

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here