C program to hide the mouse pointers.

C program to hide the mouse pointers.
In this program, we hide the mouse pointers using graphics.h and dos.h library functions.
To use graphics.h, we have to install the drivers in to the the system by using the initgraph() function.
In this program,we also check the condition that mouse pointer is available or not. Read more about C Programming Language . and read the C Programming Language (2nd Edition). by K and R.

/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/

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

void showmouseptr();
void hidemouseptr();

union REGS i, o;

int main()
{
int count = 1, gd = DETECT, gm;

initgraph(&gd,&gm,"C:\TC\BGI");/*check your path, to install the drivers in to the the system*/

i.x.ax = 0;
int86(0X33,&i,&o);
if(o.x.ax == 0)
{
printf("nt Sorry! Mouse support not available !");
}
else
{
showmouseptr();

while(count<=10)
{
getch();
count++;
if(count%2==0)
hidemouseptr();
else
showmouseptr();
}
}

getch();
return 0;
}


void showmouseptr()
{
i.x.ax = 1;
int86(0X33,&i,&o);
}

void hidemouseptr()
{
i.x.ax = 2; // to hide mouse
int86(0X33,&i,&o);
}
Read more Similar C Programs
 
Graphics in C

C Strings

C Aptitude

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

To browse more C Programs visit this link
(c) www.c-program-example.com

C Program to change the text colors.

Write a C Program to change the text colors.
In this program, we give the example of changing the text colors, background colors using conio.h library.
Syntax: void textcolor(int_color);
Here color is the integer variable, you can specify a color name also, but it should be a proper color name in capital letters.
Read more about C Programming Language . and read the C Programming Language (2nd Edition). by K and R.

/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/

#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
textcolor(BLUE); // Change font colour to blue
textbackground(WHITE); //change the background colour to white
cprintf("Color is Blue with white backgroundnn");
clrscr();
textcolor(RED+BLINK);//this one is blinking the text
cprintf("Color is RED with blinkingnn");
return 0;
}
Read more Similar C Programs
 
Graphics in C

C Strings 
 
C Aptitude 
 

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

To browse more C Programs visit this link
(c) www.c-program-example.com

C program to draw a circle using c graphics.

Write C program to draw a circle using c graphics.
In this program we use the graphics.h library function to draw a circle. To use graphics.h, we have to install the drivers in to the the system by using the initgraph() function. In the program circle is the graphic function , which takes three parameters, first two are co-ordinates and the third one is the radius of the circle. Read more about C Programming Language.

/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/

#include <graphics.h>

main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, "C:\TC\BGI");

circle(25, 25, 100);

getch();
closegraph();
return 0;
}
Read more Similar C Programs
Learn C Programming

Number System

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

To browse more C Programs visit this link
(c) www.c-program-example.com

C Program to generate Graph using grphics.h

C Program to Generate the graph sheet using the grphics.h library. To use graphics.h, we have to install the drivers in to the the system by using the initgraph() function. Here  we derive the graph of input sizes verses time taken for input sizes. x axis represents inputs(0,10000,20000,—-), y axis rep time(0,0.05,0.1,0.15—). Read more about C Programming Language.

/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/

#include "stdio.h"
#include "conio.h"
#include "graphics.h"
void main() {
int gd = DETECT, gm;
int y = 0, x = 10, m[20], k[20], n, a[20], i;
float b[20];
initgraph(&gd, &gm, "c:\tc\bgi");
printf("nntGenerating the Graphsnn");
printf("nEnter the no. of inputst");
scanf("%d", &n);
printf("nEnter the input sizes and corresponding time takenn");
for (i = 0; i < n; i++) {
printf("nEnter input sizet");
scanf("%d", &a[i]);
printf("nEnter time takent");
scanf("%f", &b[i]);
}
cleardevice();
//represents y axis
line(10, 0, 10, 400);
//represents x axis
line(10, 400, 600, 400);
while (y <= 400) {
line(0, y, 10, y);
y = y + 20;
}
while (x <= 600) {
line(x, 400, x, 410);
x = x + 20;
}
outtextxy(20, 440, "1unit=20 pixels , origin is (10,400)");
outtextxy(
20,
450,
"x axis represents inputs(0,10000,20000,----), yaxis rep time(0,0.05,0.1,0.15---)");
setcolor(5);
for (i = 0; i < n; i++) {
k[i] = (a[i] * 0.002);
m[i] = (400 - (b[i] * 400));
putpixel(k[i], m[i], 11);
}
for (i = 0; i < n - 1; i++)
line(k[i], m[i], k[i + 1], m[i + 1]);
getch();
}
Read more Similar C Programs
Learn C Programming

Number System

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

To browse more C Programs visit this link
(c) www.c-program-example.com