You are on page 1of 8

ABOUT C LANGUAGE PROGRAMS

Hello everybody here are some few programs written in turbo c++ IDE As
shown in following
And the program is to find area and circumference as shown below:

And the output is shown below:

After writing all the program check whether the program contains errors
or not by giving the command like alt+f9 and if there are no errors in the
program then execute the program by giving ctrl+f9 and if the program
has some input values to be entered then give the input and to move on to
main program then type \r i.e to return to main program thats it.
Now reverse of a number:

And its output:

Program: Modulus of a number |n| i.e -14 is 14

Output displayed:

In the above program if(n<0); plays an important role in order to get the
desired output so make sure that it is given correct in the main program

Program to display Major or Minor using the age specified:

output displayed on the screen:

In the above program the output will be displayed according to the


condition that was given in the program that if(age<=18); hence it the
main instruction for this program irrespective of the inputs given in the
program.

Program to find quotient of a division:

Output displayed on the screen:

In the above program if we want to display quotient of a division then use


the appropriate condition so that the output will be displayed on the

screen a/c to the specified condition i.e if(b!=0) which means if the
variable a acting as numerator and b is denominator then division is
possible if and only if the denominator number is other than zero.
Program: swapping of two numbers

Output displayed:

This program just swaps or exchanges the values and displays it on the
monitor screen for ex: x=25; y=12; then after executing the program with
this input values output will be x=12; y=25 thats it. Logics must be
written correct in order to obtain the correct result.
Program: finding Biggest among two numbers

Output displayed:

Here is the output to find the biggest number between two numbers logics
must be correctly specified in order to get the correct result.
Ex: a=25; b=50
Then biggest number is 50 that should be displayed on the screen.

You might also like