What is the output of the following C program?
#include <stdio.h>
void main(){
int a = -7;
float b;
b = a++;
printf("%d, %f ", a, ++b);
}b = a++; assigns the current value of a (−7) to b and then increments a to −6.
Later, ++b increments b from −7 to −6 before printing.
$$ a = -6,\quad b = -6.000000 $$
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.