C PROGRAMMING EXAMPLES





c program examples

C program examples :- These programs illustrate various programming elements, concepts such as using operators, loops, functions, single and double dimensional arrays, performing operations on strings, files, pointers etc. Browse the code from simple c program to complicated ones you are looking for, every one of them is provided with output. C program download with executable files, so that you save on your computer and run programs without compiling the source code. All programs are made using c programming language and Turbo C compiler, most of these will work under Dev c++ compiler also. The first program prints "Hello World" on screen.


C codes


c mouse programs

Mouse programs using c :- Do everything with mouse using these c programs or source codes, on this page you will find sample mouse programs using c. Programs ranging from how to use mouse in c graphics and in text mode. how to initialize mouse, how to know where the mouse is clicked, which mouse button is clicked i.e left or right, how to restrict mouse pointer.
Below is a list of mouse programs made using c language. Mouse interrupt is handled using int86 function of dos.h header file. All these programs have been made using turbo c compiler.


C source codes

Given below is a list of c projects and games, all of them are provided for free with complete source code and executable files.


java programs

functions of graphics.h

C graphics using graphics.h functions or WinBGIM (Windows 7 ) can be used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics.h in turbo c compiler you can make graphics programs, animations, projects and games.You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them. Following is a list of functions of graphics.h header file. Every function is discussed with the arguments it needs, its description, possible errors while using that function and a sample c graphics program with its output.

C graphics

C graphics functions

Graphics in windows 7 or vista

Most of the functions are two dimensional except bar3d which draws a 3d bar, you can also implement these functions using already existing algorithms. You can also use these functions in c++ programs. You can use these functions for developing programs in Windows 7 and Vista using Dev C++ compiler. For that you need to download an additional package WinBGIm, download WinBGIm. Now open Dev C++ compiler go to tools->Package Manager, click on install and then browse the package location. Now create new project and select WinBGIm.
This library also offers many functions which can be used for image manipulation, you can open image files, create bitmaps and print images, RGB colors and mouse handling.

C graphics programs


c graphics programs

All these program have been made using c graphics. Program for various type of charts and other interesting things and patterns.

C graphics codes


conio.h

conio.h header contains functions for console input/output. Some of the most commonly used functions of conio.h are clrscr, getch, getche, kbhit etc. Functions of conio.h can be used to clear screen, change color of text and background, move text, check if a key is pressed or not and many more. conio.h file is provided by borland turbo c compiler and gcc compiler doesn't support it.

Conio.h functions

math.h

math.h contains functions to perform mathematical operations often required in c programs such as calculating absolute value of a number, calculating logarithms and using trigonometric functions to calculate sin, cos of a number.

math.h functions

dos.h

dos.h in c: dos.h header file of c language contains functions for handling interrupts, producing sound, date and time functions etc. It is borland specific and works in turbo c compiler.

dos.h functions