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
- Hello world
- Print Integer
- Addition
- Add, subtract, multiply and divide
- Check vowel
- Leap year
- Add digits
- Factorial
- ncR and nPr
- Add n numbers
- Swapping
- Reverse number
- Palindrome number
- Print Pattern
- Diamond
- Prime numbers
- Find armstrong number
- Generate armstrong number
- Fibonacci series
- Print floyd's triangle
- Print pascal triangle
- Addition using pointers
- Maximum element in array
- Minimum element in array
- Linear search
- Binary search
- Reverse array
- Insert element in array
- Delete element from array
- Bubble sort
- Insertion sort
- Selection sort
- Add matrices
- Subtract matrices
- Transpose matrix
- Multiply two matrices
- Print string
- String length
- Compare strings
- Copy string
- Concatenate strings
- Reverse string
- Find palindrome
- Delete vowels
- C substring
- Sort a string
- Remove spaces
- Change case
- Swap strings
- Character's frequency
- Anagrams
- Read file
- Copy files
- Merge two files
- List files in a directory
- Delete file
- Random numbers
- Add complex numbers
- Print date
- Get ip address
- Shutdown computer
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.
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.
- Check if mouse support is available or not
- Display mouse pointer in textmode
- Display mouse pointer in graphics mode
- hide mouse pointer
- Current position of mouse pointer
- Determine which mouse button is clicked
- Restrict mouse pointer in rectangle
- Restrict mouse pointer in circle
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.
- paint program
- press me button game
- web browser
- Traffic Light Program
- C Program to perform operations on complex numbers
- c program to restrict mouse pointer in circle
- captcha
- moving car
- Anagrams
java programs
- hello world
- print alphabets
- print multiplication table
- get input from user
- add two numbers
- find odd or even number
- swap two numbers
- largest of three numbers
- factorial
- print prime numbers
- armstrong number
- Floyd's triangle
- reverse string
- palindrome
- compare strings
- substrings of string
- display current date and time
- garbage collection
- ip address
- reverse number
- add matrices
- transpose matrix
- multiply matrices
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.
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
C graphics functions
- arc
- bar
- bar3d
- circle
- cleardevice
- closegraph
- drawpoly
- ellipse
- fillellipse
- fillpoly
- floodfill
- getarccords
- getbkcolor
- getcolor
- getdrivername
- getimage
- getmaxcolor
- getmaxx
- getmaxy
- getpixel
- getx
- gety
- graphdefaults
- grapherrormsg
- imagesize
- line
- lineto
- linerel
- moveto
- moverel
- outtext
- outtextxy
- pieslice
- putimage
- putpixel
- rectangle
- sector
- setbkcolor
- setcolor
- setfillstyle
- setlinestyle
- settextstyle
- setviewport
- textheight
- textwidth
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
- Draw shapes
- Bar chart
- Pie chart
- 3d bar chart
- Smiling face animation
- captcha
- Circles in circles
- Countdown
- Paint program in c
- Press me button game
- Web browser program
- Traffic Light Simulation
- Mouse pointer restricted in circle
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
- draw shapes
- bar chart
- pie chart
- moving car
- 3d bar chart
- Smiling face animation
- captcha
- Circles in circles
- Countdown
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.