Placement Papers: C Questions What is the Output
Get top class preparation for competitive exams right from your home: get questions, notes, tests, video lectures and more- for all subjects of your exam.
- main () {char a [2] ⚹ a [0] = 7; ⚹ a [1] = 5; printf ( “% d” &a [1] -a) } ANS: Ans may be 1 (illegal initialization) .
- #include main () {char a [] = “hellow” char ⚹ b = “hellow” char c [5] = “hellow” printf ( “% s % s % s” a, b, c) ; printf ( “” sizeof (a) , sizeof (b) , sizeof (c) ) ;} (ans is hellow, hellow, hellow 6,2, 5)
- #include main () {float value = 10.00; printf ( “% g % 0.2g % 0.4g % f” value, value, value, value) } (ans is 10,10, 10,10.000000)
- #include void function1; int i-value = 100; main () {i-value = 50; function1; printf ( “i-value in the function =” i-value) ; printf ( “i-value after the function =” i-value) ;}
printf ( “i-value at the end of main =” i-value) ; functioni () i-value = 25.