ADVANCE C OBJECTIVE QUESTIONS


Advanced c programming language objective type questions and answers with explanation


(1) What will happen when you will compile and execute the following code?

#include<dos.h>
#include<stdio.h>
void main()
{
int x,y,b;
union REGS i,o;
i.h.ah=0;
i.h.al=0x13;
int86(0x10,&i,&o);
getch();
}

(a)It will switch to 32 bit color graphics mode.
(b)It will switch to 256 bit color graphics mode.
(c)It will switch to 32 bit text mode.
(d)It will switch to 256 bit text mode.

Answer: (b)

(2) What will happen when you will compile and execute the following code?

#include<dos.h>
void main()
{
union REGS i,o;
i.h.ah=0x39;
i.x.dx="ravan";
int86(0x21,&i,&o);
getch();
}

(a) It will create a file in current working directory.
(b) It will create a file in bin directory.
(c) It will create a directory in current working directory.
(d) It will create a directory in bin directory.

No comments: