Found 38 Questions For C Programming

How to Find Area of Scalene Triangle using C

Updated 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 : %f", area); return (0); } Output : Ente... Read Mores

How to Calculate Area of Equilatral Triangle using C Language

Updated 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 triangle is a triangle in which all three sides a... Read Mores

How to print hello world using C Language

Updated on 12-Dec-2021 9:39:30
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 Mores

How to Check Whether Number is Perfect Or Not using C

Updated on 04-Apr-2023 8:23:19
C Program to Check Whether Number is Perfect Or Not Hello there, in this tutorial we will learn to check whether number is perfect or not using c programming ? Also Use : Perfect Number Checker Tool What Is Perfect Number : A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. #include <stdio.h> int main() { int num, i = 1, sum = 0; printf("Enter a number: "); scanf("%d", &num); while (i < num) { i... Read Mores

How to convert temperature from degree centigrade to Fahrenheit using C

Updated 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 Mores

How to find area and circumference of circle using C Programming

Updated on 12-Apr-2023 18:11:54
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 Circumference : 6.28 Explanation of Program : In this program we have to calculate ... Read Mores

How to find gretest in 3 number using C Programming

Updated on 12-Dec-2021 9:00:53
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 a,b & c : 15 17 21 c is greatest ... Read Mores

How to find sum of two numbers using C Language

Updated on 12-Dec-2021 9:06:20
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 Mores



Advertisements

ads