PPS Lab Solution
PPS Lab Solution
h>
int main() {
printf("###########################################################\n");
printf("Welcome!\n\n");
printf("3. Exit\n\n");
printf("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n");
return 0;
#include <stdio.h>
int main() {
// Quizzes section
printf("=======Quizzes===============\n");
printf("Enter the score of the first quiz: ");
scanf("%d", &quiz1);
scanf("%d", &quiz2);
scanf("%d", &quiz3);
// Mid-term section
printf("=======Mid-term==============\n");
scanf("%d", &midTerm);
// Final section
printf("=======Final=================\n");
scanf("%d", &finalExam);
printf("……………………\n");
return 0;
}
#include <stdio.h>
int main() {
char name[50];
char rollNumber[20];
char address[100];
int age;
float weight;
double height;
float cgpa;
// Taking inputs
scanf("%d", &age);
scanf("%f", &weight);
printf("Enter Height (in meters): ");
scanf("%lf", &height);
scanf("%f", &cgpa);
return 0;
#include <stdio.h>
int main() {
char name[50];
char rollNumber[20];
int ageMonths;
float weightKg;
float heightMeters;
// Taking inputs
scanf("%f", &ageYears);
scanf("%f", &weightGrams);
scanf("%f", &heightCm);
scanf("%f", &cgpa);
// Convert units
#include <stdio.h>
int main() {
// Taking inputs
scanf("%ld", &hours);
scanf("%ld", &minutes);
scanf("%ld", &seconds);
return 0;
}
#include <stdio.h>
int main() {
double x, y;
double p, s, total;
// Step a: Read x
scanf("%lf", &x);
// Step b: Read y
scanf("%lf", &y);
// Step c: Compute p = x * y
p = x * y;
// Step d: Compute s = x + y
s = x + y;
total = (s * s) + p * (s - x) * (p + y);
return 0;
}
#include <stdio.h>
int main() {
float celsius;
float fahrenheit;
scanf("%f", &celsius);
return 0;
#include <stdio.h>
int main() {
float celsius;
float fahrenheit;
scanf("%f", &celsius);
return 0;
#include <stdio.h>
int main() {
int numberOfShares;
scanf("%d", &numberOfShares);
printf("Enter the price of the stock (per share) when purchased: ");
scanf("%f", &purchasePrice);
scanf("%f", ¤tPrice);
printf("You have made a profit of $%.2f dollars since you bought %d shares of this stock.\n", profit,
numberOfShares);
return 0;