C language programs script:
Code:
// This is the C Language Program for Adding 5 Subjects marks and then summing them up and their percentage
#include<stdio.h>
#include<conio.h>
int main()
{
float math, eng, phy, urdu, chem, sum, percentage;
printf("Enter Marks for Maths: ");
scanf("%f", &math);
printf("Enter Marks for English: ");
scanf("%f", &eng);
printf("Enter Marks for Physics: ");
scanf("%f", &phy);
printf("Enter Marks for Urdu: ");
scanf("%f", &urdu);
printf("Enter Marks for Chemistry: ");
scanf("%f", &chem);
sum=math+eng+phy+chem+urdu;
percentage=sum/500.00*100.00;
printf("\nRESULT:\nTotal Nummber Obtained are: %f\n\nPercentage: %f", sum, percentage);
getch();
return 0;
}
Code:
#include<stdio.h> // This proram is about converting Fahrenheit to Centigrade
#include<conio.h>
int main()
{
float far, cen;
printf("Enter temperature in Fahrenheit: ");
scanf("%f", &far);
cen=5.0*(far-32.0)/9.0;
printf("The Temperature in Centigrade = %f", cen);
getch();
return 0;
}
Bookmarks