Memory Size of the System

25. Program to get the memory size of the system?

Program

#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
 union REGS in,out;
 clrscr();
 int86(0x12,&in,&out);           //Calling the interupt
 printf("\nMEMORY SIZE IS:%d kb",out.x.ax);    //Memory size in AX register
 getch();
}

Output

MEMORY SIZE IS:640 kb

No comments:

Post a Comment