Computer Sciences > GATE 2026 SET-1 > C Programming
Consider the following program in C:
#include <stdio.h>
void func(int i, int j) {
if(i < j) {
int i = 0;
while (i < 10) {
j += 2;
i++;
}
}
printf("%d", i);
}
int main() {
int i = 9, j = 10;
func(i, j);
return 0;
}

The output of the program is _________. (answer in integer)
Note: Assume that the program compiles and runs successfully.

Correct : 9

Similar Questions

Consider the following two functions void fun1(int n){ &nbsp; &nbsp; if(n == 0) return; &nbsp; &nbsp; &nbsp; printf(β€œ%d”, n); &nbsp; &nbsp; fun2(n-2); &...
#175 MCQ
Consider the C functions foo and bar given below: int foo(int val) { &nbsp; &nbsp; int x = 0; &nbsp; &nbsp; while (val > 0) &nbsp; &nbsp; { &nbsp; &nbsp; &nbs...
#190 MCQ
What is printed by the following ANSI C program? #include&lt;stdio.h&gt; int main(int argc, char *argv[]) { &nbsp; &nbsp; int a[3][3][3] = &nbsp; &nbsp; {{...
#311 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......