Tag Archives: examples

C program to add two numbers and display sum in the screen

CODES: View the code on Gist. OUTPUTS: enter values of a and b: 2 3 the sum is 5.00

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program to read a character from user and display it ASCII value

CODES: View the code on Gist. CODES: enter a character: B the ASCII value of character B is 66

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program to read three sides of a triangle and calculate the area

CODES: View the code on Gist. OUTPUTS: enter three sides of triangle a,b,c:3 4 5 the area of the triangle is :6.00

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program to read height and base of a triangle and find the area of it

CODES: View the code on Gist. OUTPUTS: enter the height of triangle:5 enter the base of triangle :3.5 the area of the triangle is:8.75

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program to calculate the area and perimeter of rectangle

CODES: View the code on Gist. OUTPUTS: enter the length and breadth of a rectangle :2.5  1.5 the area of rectangle is :3.750000 the perimeter of rectangle is :8.000000

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program that asks name of student and marks obtained by him/her in seven subjects and display the percentage of students assuming full marks 100 for each subject

CODES: View the code on Gist. OUTPUTS: enter the name of student:gauri enter the marks in different seven subjects:90 23 56 89 65 44 65 the percentage of shyam is:61.71  

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program that will convert temperature in fahrenheit into centigrade

CODES: View the code on Gist. OUTPUTS: enter the temperature in fahrenheit:101 the equivalent temperature in centigrade  :38.33

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program that will convert temperature in centigrade into fahrenheit

CODES: View the code on Gist. OUTPUTS: enter the temperature in centigrade: 41 the equivalent temperature in fahrenheit is :105.80

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C program to calculate area between two concentric circles having radius r1 and r2 cm by using symbolic constant for values of PI.

CODES: View the code on Gist. OUTPUTS: enter the radius of large circle:5 enter the radius of small circle:3 the area of the first circle is:78.57 the area of second circle is:28.29 the area between two circle is :50.28

Posted in C, Fundamentals of C | Tagged , , , , , | Leave a comment

C++ program to define an enumerator color with various names of color as its members,read an integer from user and display color name corresponding to an integer.

View the code on Gist. OUTPUTS: enter the color number = 2 the color is green guys !!

Posted in C | Tagged , , , , , , | Leave a comment