Functions

Q1:
What will be the output of the program in 16 bit platform (Turbo C under DOS)?
#include<stdio.h>

int main()
{
    int fun();
    int i;
    i = fun();
    printf('%d\n', i);
    return 0;
}
int fun()
{
    _AX = 1990;
}

A Garbage value

B 0 (Zero)

C 1990

D No output

ANS:A - Garbage value

Turbo C (Windows): The return value of the function is taken from the Accumulator _AX=1990. But it may not work as expected in GCC compiler (Linux).



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.