C program to convert Celsius to Fahrenheit using while loop

To convert Celsius to Fahrenheit #include <stdio.h> #include <stdlib.h> int main() { float celsius, fahrenheit; printf(“\nEnter temperature in celsius: “); scanf(“%f”, &celsius); fahrenheit = (1.8) * celsius + 32; printf(“\n%f deg celsius is %f fahrenheit\n”, celsius, fahrenheit); return 0; }  

C Program to Make a Simple Calculator Using switch case

Simple Calculator using switch Statement #include <stdio.h> int main() { char operator; double first, second; printf(“Enter an operator (+, -, *,): “); scanf(“%c”, &operator); printf(“Enter two operands: “); scanf(“%lf %lf”, &first, &second); switch (operator) { case ‘+’: printf(“%.1lf + %.1lf = %.1lf”, first, second, first + second); break; case ‘-‘: printf(“%.1lf – %.1lf = %.1lf”, … Read more

C Program to Find the Size of int, float, double and char

Program to Find the Size of Variables #include<stdio.h> int main() { int intType; float floatType; double doubleType; char charType; // sizeof evaluates the size of a variable printf(“Size of int: %ld bytes\n”, sizeof(intType)); printf(“Size of float: %ld bytes\n”, sizeof(floatType)); printf(“Size of double: %ld bytes\n”, sizeof(doubleType)); printf(“Size of char: %ld byte\n”, sizeof(charType)); return 0; }

C Program to Multiply Two Floating-Point Numbers

Program to Multiply Two Numbers #include <stdio.h> int main() { double a, b, product; printf(“Enter two numbers: “); scanf(“%lf %lf”, &a, &b); // Calculating product product = a * b; // Result up to 2 decimal point is displayed using %.2lf printf(“Product = %.2lf”, product); return 0; }

C Program to Find the Largest Number Among Three Numbers

Using if Statement #include <stdio.h> int main() { double n1, n2, n3; printf(“Enter three different numbers: “); scanf(“%lf %lf %lf”, &n1, &n2, &n3); if (n1 >= n2 && n1 >= n3) printf(“%.2f is the largest number.”, n1); if (n2 >= n1 && n2 >= n3) printf(“%.2f is the largest number.”, n2); if (n3 >= n1 … Read more