Pages

Mar 25, 2013

Difference between Sleep and Hibernate

Sleep is actually stand by mode.
The computer goes into a power state and has all the memory still in the RAM. It just logs you off and can return to the same state as before.


but in hibernation the data in your RAM is put into your hard drive and your PC shuts down as usual excepts for the saving of info. The next time you switch on your PC it will reload and return to the same state as before no matter after how much time that is. It does not consume any power as it turned off and you don't lose any data whatsoever. It does take memory space. it takes the amount of memory your RAM has.

Mar 2, 2013

wap in c++ to draw a line using DDA Algorithm


#include <graphics.h>
#include <conio.h>
#include <iostream.h>

void main()
{
int gdriver=DETECT, gmode;
initgraph(&gdriver,&gmode, "");
int x1,x2,y1,y2,dx,dy,m;

cout<<"Enter Values for x1,x2,y1,y2: ";
cin>>x1>>x2>>y1>>y2;

while(x1!=x2 && y1!=y2)
{
if(x1<x2)
{
dx = x2-x1;  dy = y2-y1; m=dy/dx;
putpixel(x1,y1,RED);

if(m<=1)
{
x1++;
y1 = y1+m;
}
if(m>1)
{
y1++;
x1 = x1 + (1/m);
}
putpixel(x1,y1,RED);
}
if(x2<x1)
{
dx = x2-x1;  dy = y2-y1; m=dy/dx;
putpixel(x1,y1,RED);

if(m<=1)
{
x1--;
y1 = y1-m;
}
if(m>1)
{
y1--;
x1 = x1 - (1/m);
}
putpixel(x1,y1,RED);
}

}

getch();
}