Home / C

C

Restrict Mouse Pointer Position C Graphics Program

This C Program will restrict the Mouse Pointer location or to a particular position or x,y coordinates. The C Graphics Mouse Program will give you more insights. The Other Similar Programs are: Restrict Mouse Pointer in Circle Restrict Mouse Pointer in Rectangle //restrict the x and y coordinate #include <dos.h> #include <stdio.h> void main() { union REGS i,o; //show mouse pointer i.x.ax=1; int86(0x33,&i,&o); ...

Read More »

C Program to restrict Mouse pointer in a Rectangle

This C Program will restrict the Mouse pointer Position in the Rectangle. The Mouse Programs are listed here if you want to learn more C Graphics Programs for Mouse. Also If you want to learn how to restrict the Mouse Pointer in Circle then check here. #include<dos.h> #include<graphics.h> #include<conio.h> int initmouse(); void showmouseptr(); void hidemouseptr(); void restrictmouseptr(int, int, int, int); union REGS i, o; main() { ...

Read More »

Restrict Mouse Pointer in Circle C program

How to restrict Mouse Pointer in Circle using c Graphics Programming is given here. #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> #include<math.h> union REGS i, o; int initmouse() { i.x.ax = 0; int86(0X33, &i, &o); return ( o.x.ax ); } void showmousepointer() { i.x.ax = 1; int86(0X33, &i, &o); } void hidemopusepointer() { i.x.ax = 2; int86(0X33,&i,&o); } void getmousepos(int *x, int *y) { ...

Read More »

Hide Mouse Pointer C Program

How to Hide a Mouse Pointer Program in C : This program will show and hide the mouse pointer after each user input by a key stroke. Illustration & Example: There are two functions used in the program- showmousepointer(); -> To Show / display the pointer hidemousepointer(); -> to Hide / disappear the pointer   Initialise the Graphics using a graphic driver variable. Then ...

Read More »

C Program to find the Largest Digit in the Number

Write a Program in C to find the Largest Digit in the number. This is a simple code which will use a While loop or a for loop However while loop is the best option for this type of problem. The two methods are mentioned here but there can be many solutions for the same with each individual having its own programming Logic. ...

Read More »

While Loop in C Syntax, Flow Chart and Example

While Loop in C: While loop is a conditional control looping statement in C which is used in iterative logics. In While Loops the et of instructions given inside the loop keeps on repeating until the condition becomes false. While Loop Syntax while(condition) { statement(s); } Here, statement(s) may be a single statement or a set of multiple statements. Condition can be any ...

Read More »

C Program to get current position of a mouse pointer

This is a C program to get the Current Mouse pointer location or position as a output in C Graphics. When you move your cursor the Mouse location will change with the pointer itself. This is a Program in C Graphics which used 3 user defined functions. hidemouseptr(); -> Used to hide the Mouse Pointer showmouseptr(); -> To Show the ...

Read More »

Program to Display Upper Triangular Matrix

What is Upper Triangular Matrix?  An upper triangular matrix is a square matrix in which all the elements below the diagonal are zero. We consider a Matrix U with ‘i’ rows and ‘j’ columns, then mathematically we represent the upper triangular matrix as In another word strictly upper triangular matrix is an upper triangular matrix having 0’s along the diagonal ...

Read More »

Program to check Upper Triangular matrix

What is Upper Triangular Matrix?  An upper triangular matrix is a square matrix in which all the elements below the diagonal are zero. We consider a Matrix U with ‘i’ rows and ‘j’ columns, then mathematically we represent the upper triangular matrix as In another word strictly upper triangular matrix is an upper triangular matrix having 0’s along the diagonal ...

Read More »

C program to Calculate Sum of Digits of a Number

C Program to find Digit Sum:  The digit sum of a given integer number is the sum of all its digits. The source code given here are for two methods or rather tricks in C language. Digit Sum Example:-   Digit Sum of 12321 is calculated 1+2+3+2+1=9. Digit Sum of 34236789754 is calculated 3+4+2+3+6+7+8+9+7+5+4=58. We have also given the Solution of the ...

Read More »