(b)Graphics video memory:
Segment number 0XA is known as graphics video memory. This segment has 720 columns and 400 rows.
Intersection of rows and columns is known as pixel. Size of each pixel is one byte which stores color information.
Example:
(q)What will be output of following c program?
#include <dos.h>
#include<stdio.h>
#include<stdio.h>
int main(){
int j;
union REGS i,o;
char far *ptr=(char *)0XA0000000;
i.h.ah=0;
i.h.al=0x13;
int86(0x10,&i,&o);
for(j=1;j<=100;j++){
*(ptr+j)=4;
}
return 0;
return 0;
}
Output: One red color line in the graphics console as shown in the following figure
In the above program what is following codes?
union REGS i,o;
i.h.ah=0;
i.h.al=0x13;
int86(0x10,&i,&o);
Answer:
The task of this code is to switch the 256 bit color graphics console window from default console window of Turbo c++ IDE.
More examples:
Copy the following code and execute the code in Turbo c compile and see what is displaying.
(1)What will be output of following c program?
#include <dos.h>
#include<stdio.h>
#include<stdio.h>
int main(){
int j,k;
union REGS i,o;
char far *ptr=(char *)0XA0000000;
i.h.ah=0;
i.h.al=0x13;
int86(0x10,&i,&o);
for(k=0;k<100;k++){
for(j=1;j<=319;j++){
*(ptr+j+k*320)=k;
}
}
return 0;
return 0;
}
(2)What will be output of following c program?
#include <dos.h>
#include<stdio.h>
#include<stdio.h>
int main(){
int j,k;
union REGS i,o;
char far *ptr=(char *)0XA0000000;
i.h.ah=0;
i.h.al=0x13;
int86(0x10,&i,&o);
for(k=0;k<100;k++){
for(j=1;j<=319;j++){
*(ptr+j+k*320)=k;
}
}
return 0;
return 0;
}
Generic pointer
Null pointer
Wild pointer
Dangling pointer
Near pointer
Far pointer
Graphics video memory
Text video memory
Huge pointer
Memory model in C
C tutorial

2 comments:
the above programs are not compiled in computer.why i don't know. when i run this is program the console is automatically closed. I think it not a correct program.
Here you will find simple C programming questions with answers basically asked in technical interviews.
Sample C Program For Inserting An Element In An Array.
Sample C Program To Count Frequency Of Elements In An Array.
Sample C Program On Two Dimensional (2-D) Array / Matrix.
Sample C Program To Find Transpose a 3 * 2 matrix.
Sample C Program To Multiply Two 3 * 3 Matrix.
Sample C Program To Add Two 3 * 3 Matrix.
Sample C Program To Swap Two Strings Using strcpy() Function.
Sample C Program To Sort A Given Number Of Strings Using strcmp() Function.
Sample C Program To Display Array Of Strings.
Sample C Program To Convert String To An Integer Using atoi() Function.
Sample C Program To Find The Length Of A String.
Sample C Program To Concatenate Two Strings.
Sample C Program To Swap Two Strings.
Sample C Program To Compare Two Strings.
Sample C Program To Check Whether A String Is Palindrome Or Not.
Sample C Program To Print The Reverse Of A String.
Sample C Program To Join Two Strings.
Post a Comment