1. Question:Write a c program to display mouse pointer? 

    Answer
    #include <dos.h>
    #include <stdio.h>
    void main()
    {
    union REGS i,o;
    i.x.ax=1;
    int86(0x33,&i,&o);
    getch();
    }






    1. Report
  2. Question:Write the c program to switch the 256 color graphics mode 

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






    1. Report
  3. Question:Write a c program to create a directory in current working directory? 

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






    1. Report
  4. Question:Write a c programming code to create simple paint brush software or application 

    Answer
    #include<dos.h>
    #include<stdio.h>
    #include<graphics.h>
    #include<stdlib.h>
    void main()
    {
    int x,y,b,px,py,c,p,s,cl;
    int d=0,m;
    union REGS i,o;
    initgraph(&d,&m,"c:\tc");
    i.x.ax=1;
    int86(0x33,&i,&o);
    i.x.ax=8;
    i.x.cx=20;
    i.x.dx=450;
    int86(0x33,&i,&o);
    printf("Brush style insert number from 0 to 5  : ");
    scanf("%d",&p);
    printf("Brush size insert number from 1  to 7  : ");
    scanf("%d",&s);
    printf("Brush color insert number from 1 to 16 : ");
    scanf("%d",&cl);
    clrscr();
    cleardevice();
    printf("\t\t**********DRAW IMAGE************");
    while(!kbhit())
    {
    i.x.ax=3;
    b=o.x.bx;
    x=o.x.cx;
    y=o.x.dx;
    px=x;
    py=y;
    int86(0x33,&i,&o);
    if(cl==16)
    {
    c=random(16);
    }
    else
    {
    c=cl;
    }
    setcolor(c);
    if(b==1)
    {
    i.x.ax=3;
    int86(0x33,&i,&o);
    x=o.x.cx;
    y=o.x.dx;
    b=o.x.bx;
    switch(p)
    {
    case 1:circle(px,py,s);break;
    case 2:ellipse(px,py,0,270,s,s+2);break;
    case 3:fillellipse(px,py,s+2,s);break;
    case 4:rectangle(px,py,x,y);break;
    case 5:sector(px,py,30,120,s,s);break;
    default:line(px,py,x,y);
    }
    }
    }
    getch();
    restorecrtmode();
    closegraph();
    }






    1. Report
  5. Question:Write c program which shutdown the window operating system? 

    Answer
    Step 1: Write the following program in TURBO C.
    #include<stdio.h>
    #include<dos.h>
    
    int main (void){
        system("shutdown -s");
        return 0;
    }
    Step 2: Save the above file. Let file name is close.c Step 3: Only compile the above program. Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the close.c (default directory c:\tc\bin) Step 5: Double click on its .exe file (close.exe) After some time your window operating system will shutdown.






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd