ISRO CS 2015
August 27, 2024C-Programming
August 27, 2024C-Programming
Question 40
|
What is the output when the following segment of ‘c’ code is executed?
Void main (){
Float a = 123.456
printf(“%7.2f, %7.3f, %12e, a, a, a);
}
123.450, 123.4560, 1.234560e+02
|
|
123.46, 123.456, 1.234560e+02
|
|
123.456000, 123.456, 0.1234560e+03
|
|
123.45, 123.4560, 1.234560e+02
|
Question 40 Explanation:
→The conversion specifier %7.2f tells printf to display the value as a 7-character wide field with 2 digits following the decimal point.
→The %e format uses scientific notation, i.e. one digit before the decimal separator and an exponent for scaling
→The %e format uses scientific notation, i.e. one digit before the decimal separator and an exponent for scaling
Correct Answer: B
Question 40 Explanation:
→The conversion specifier %7.2f tells printf to display the value as a 7-character wide field with 2 digits following the decimal point.
→The %e format uses scientific notation, i.e. one digit before the decimal separator and an exponent for scaling
→The %e format uses scientific notation, i.e. one digit before the decimal separator and an exponent for scaling
Subscribe
Login
0 Comments