1. Create a program that multiply,divide, and subtract two numbers.Then,make a pseudocode, algorithm and flowchart on it.
2.Temperature of a city in Fahrenheit degrees is input through the keyboard (use scanf() function in your program to ask the user to input any number or string).Write pseudocode, algorithm, flowchart,and a c program to convert that temperature into centigrade Celsius.
#include <stdio.h>
int main()
{
printf("Multiplication, division, and subtraction of two numbers\n");
int a = 8, b = 5;
int substraction = a - b;
int multiplication = a * b;
float division = (float)a / (float)b;
printf("Convertion of Fahrenheit to Celsius degrees\n");
float fahrenheit = 0.0f, celsius = 0.0f;
printf("Please type degrees in Fahrenheit: ");
scanf("%f", &fahrenheit);
celsius = (fahrenheit - 32.0f) / 1.8f;
printf("The temperature in Celsius is %f\n", celsius);
return 0;
}
Comments
Leave a comment