Home » C Programming

How to Calculate Area of Rectangle using C Program

Published on 12-Dec-2021 13:06:07
C Program to Calculate Area of Rectangle Shape : Rectangle formula : area = l * b Definition : 1. A plane figure with 4 sides and 4 right angles and having Equal Opposite Sides 2. Adjucent sides makes an angle of 90 degree 3. You can compute the area of a Rectangle if you know its length and breadth Program :  #include <stdio.h> #include <conio.h> int main() { int length, breadth, area; printf("\nEnt... Read More

How to Calculate Area of Right angle Triangle using C Language

Published on 12-Dec-2021 12:56:56
C Program to Calculate Area of Right angle Triangle Definition : Triangle having one angle of measure 90 degree is called Right angle Triangle. Sides of Triangle are : base , height , hypotenuse. You can compute the area of a Tr. if you know its any two sides. Program :  #include <stdio.h> int main() { int base, height; float area; printf("\nEnter the base of Right Angle Triangle : "); scanf(... Read More

How to Find Area of Scalene Triangle using C

Published on 12-Dec-2021 12:44:54
C Program to Find Area of Scalene Triangle : #include <stdio.h> #include <math.h> int main() { int s1, s2, angle; float area; printf("\nEnter Side1 : "); scanf("%d", &s1); printf("\nEnter Side2 : "); scanf("%d", &s2); printf("\nEnter included angle : "); scanf("%d", &angle); area = (s1 * s2 * sin((M_PI / 180) * angle)) / 2; printf("\nArea of Scalene Triangle : ... Read More

How to Calculate Area of Equilatral Triangle using C Language

Published on 12-Dec-2021 9:59:37
#include<stdio.h> #include<math.h> int main() { int side; float area, r_4; r_4 = sqrt(3) / 4; printf("\nEnter the Length of Side : "); scanf("%d", &side); area = r_4 * side * side; printf("\nArea of Equilateral Triangle : %f", area); return (0); } Output : Enter the Length of Side : 5 Area of Equilateral Triangle : 10.82 Properties of Equilateral Triangle : Equilateral... Read More

How to print hello world using C Language

Published on 12-Dec-2021 9:36:41
In this example, you will learn to print "Hello, World!" on the screen in C programming. #include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; } Output : Hello, World! ... Read More

How to Check Whether Number is Perfect Or Not using C

Published on 12-Dec-2021 9:31:51
C Program to Check Whether Number is Perfect Or Not #include <stdio.h> int main() { int num, i = 1, sum = 0; printf("Enter a number: "); scanf("%d", &num); while (i < num) { if (num % i == 0) { sum = sum + i; } i++; } if (sum == num) printf("%d is a Perfect Number", i); else printf("%d is Non Perfect Number", i); return 0; } ... Read More

How to convert temperature from degree centigrade to Fahrenheit using C

Published on 12-Dec-2021 9:21:47
C Program to convert temperature from degree centigrade to Fahrenheit #include <stdio.h> int main() { float celsius, fahrenheit; printf("\nEnter temp in Celsius : "); scanf("%f", &celsius); fahrenheit = (1.8 * celsius) + 32; printf("\nTemperature in Fahrenheit : %f ", fahrenheit); return (0); } Output Enter temp in Celsius : 32 Temperature in Fahrenheit : 89.59998 ... Read More

How to find area and circumference of circle using C Programming

Published on 12-Dec-2021 9:15:04
C Program to find area and circumference of circle #include <stdio.h> int main() { int rad; float PI = 3.14, area, ci; printf("\nEnter radius of circle: "); scanf("%d", &rad); area = PI * rad * rad; printf("\nArea of circle : %f ", area); ci = 2 * PI * rad; printf("\nCircumference : %f ", ci); return (0); } Output : Enter radius of a circle : 1 Area of circle : 3.14 Circumf... Read More

How to find gretest in 3 number using C Programming

Published on 12-Dec-2021 8:57:08
C Program to find greatest in 3 numbers #include <stdio.h> int main() { int a, b, c; printf("\nEnter value of a, b & c : "); scanf("%d %d %d", &a, &b, &c); if ((a > b) && (a > c)) printf("\na is greatest"); if ((b > c) && (b > a)) printf("\nb is greatest"); if ((c > a) && (c > b)) printf("\nc is greatest"); return(0); } Output : Enter value for... Read More

How to find sum of two numbers using C Language

Published on 12-Dec-2021 8:44:14
C program to find sum of two numbers #include <stdio.h> int main() { int a, b, sum; printf("\nEnter two no: "); scanf("%d %d", &a, &b); sum = a + b; printf("Sum : %d", sum); return(0); } Output: Enter two no: 5 6 Sum : 11 ... Read More