Differences between program mode and immediate mode
Program mode (the "P" on the mode dial of most DSLRs) means that the camera still sets the exposure for you. It chooses the correct aperture and shutter speed for the light available, so your shot is correctly exposed. Program mode also unlocks other functions that give you more creative control over your images...
Immediate mode in computer graphics is a major pattern of API(Application Programming Interface) design in graphics libraries, in which the client calls directly cause rendering of graphics objects to the display, or in which the data .
Draw a line using DDA line drawing algorithm
Program: Draw a line using DDA line drawing algorithm
#include<stdio.h>
#include<graphics.h>
#include<conio.h>
#include<math.h>
void ddaline(int x1, int y1, int x2, int y2);
int main()
{
int gd=DETECT,gm,x1,y1,x2,y2;
initgraph(&gd,&gm,"c:\\tc\\bgi");
int midx=getmaxx()/2, midy=getmaxy()/2;
setcolor(WHITE);
line(0,midy,getmaxx(),midy);
line(midx,0,midx,getmaxy());
printf(“Enter starting point: “);
scanf(“%d%d”,&x1,&y1);
printf(“\nEnter ending point: “);
scanf(“%d%d”,&x2,&y2);
ddaline(x1,y1,x2,y2);
getch(); closegraph();
return 0;
}
void ddaline(int x1, int y1, int x2, int y2)
{
int midx=getmaxx()/2, midy=getmaxy()/2;
int dx=x2-x1, dy=y2-y1;
int pixel;
if(abs(dx)>abs(dy))
pixel=dx;
else
pixel=dy;
dx=dx/pixel, dy=dy/pixel;
int i=1, x=x1, y=y1;
while(i<=pixel)
{
x=x+dx;
y=y+dy;
putpixel(midx-x, midy+y, getcolor());
i++
}
}
Output :
Enter Starting Point : 20 30
Enter Ending Point : 100 110
Write down the difference between Cash basis system and Accrual basis system
Cash : It is a system in which accounting entries are made only when cash is received or paid. Cash basis system means the same as money, which is immediately available. Professional people record there income while any cash or cheque received, similarly record as expenses when actually cash or cheque paid both are in a liquid manner.
Accrual : It is a system in which accounting entries are
made only the basis of amounts having became due for payment or received. In
accrual basis system the interest or
investment is the adding together for different cases over a period of time.
Conservatism Convention
According to this convention the accountant follows the
following rules given below –
“Anticipated no profit but provide for all possible losses”,
while recording business transaction. Actually an accountant follow a policy
that is “Playing Safe”.
Subscribe to:
Posts
(
Atom
)