Solution
Solution
Solution
Quiz 3
#include <iostream>
int main() {
} else {
return 0;
}
Solution quizes
Quiz 4
#include <iostream>
#include <algorithm>
int main() {
char chars[3];
cout << "Enter 1 to sort in ascending order or 2 to sort in descending order: ";
int choice;
if (choice == 1) {
} else if (choice == 2) {
} else {
return 1;
cout << "Sorted characters: " << chars[0] << " " << chars[1] << " " << chars[2] << endl;
return 0;
}
Solution quizes
Quiz no y
#include <iostream>
#include <cmath>
int main() {
cout << "Enter base number and exponent separated by space: ";
cout << base << " raised to the power of " << exponent << " is: " << result << endl;
return 0;
Quiz no 5
#include <iostream>
int main() {
}
Solution quizes
return 0;
Quiz no pp
#include <iostream>
int main() {
int lines;
return 0;
Quiz t part a
#include <iostream>
int main() {
Solution quizes
for (int i = 1; i <= 4; ++i) {
return 0;
Part B
#include <iostream>
int main() {
int x = 5, y = 6, z = 8;
cout << "y > 12 is " << (y > 12 ? "true" : "false") << endl;
Solution quizes
return 0;
Quiz q1
#include <iostream>
int main() {
return 0;
B part
#include <iostream>
int main() {
int choice;
if (choice == 1) {
cout << "Enter " << count << " numbers:" << endl;
sum += num;
cout << "The sum of the numbers is: " << sum << endl;
} else {
return 0;
Quiz no oo part a
#include <iostream>
int main() {
cout << "Product of all odd numbers from 1 to 50 is: " << product << endl;
return 0;
Part b
#include <iostream>
int main() {
int n, m;
cout << "Enter base number and exponent separated by space: ";
result *= n;
cout << n << " raised to the power of " << m << " is: " << result << endl;
return 0;
Quiz no q2
Solution quizes
#include <iostream>
int main() {
cout << "The larger number is: " << larger << endl;
cout << "The smaller number is: " << smaller << endl;
return 0;
Quiz no q3
#include <iostream>
int main() {
float fahrenheit;
cout << "Temperature in Celsius: " << celsius << " C" << endl;
if (celsius < 0) {
return 0;
Quiz no p
#include <iostream>
#include <string>
int main() {
cout << "Enter two primary colors (red, blue, or yellow): ";
} else if ((color1 == "red" && color2 == "yellow") || (color1 == "yellow" && color2 == "red")) {
} else if ((color1 == "blue" && color2 == "yellow") || (color1 == "yellow" && color2 == "blue")) {
} else {
return 0;
Quiz no q3
#include <iostream>
int main() {
char employeeType;
char calculationType;
while (continueCalculation) {
cout << "Enter employee type (P for permanent, D for daily wages): ";
double hourlyRate;
double medicalRate;
Solution quizes
if (employeeType == 'P') {
hourlyRate = 800;
medicalRate = 0.05;
hourlyRate = 400;
medicalRate = 0.03;
} else {
cout << "Invalid employee type! Please enter P or D." << endl;
continue;
cout << "Enter C for calculating salary, M for medical charges: ";
if (calculationType == 'C') {
int hoursWorked;
double totalSalary;
} else {
cout << "Invalid calculation type! Please enter C or M." << endl;
continue;
char choice;
continueCalculation = false;
return 0;
Quiz no u
#include <iostream>
int main() {
int numBooks;
int points = 0;
Solution quizes
cout << "Enter the number of books purchased this month: ";
if (numBooks == 1) {
points = 5;
} else if (numBooks == 2) {
points = 15;
} else if (numBooks == 3) {
points = 30;
points = 60;
return 0;
Quiz no 4
#include <iostream>
int main() {
int monthNumber;
cout << "Enter a number (1-12) to find the equivalent month: ";
Solution quizes
cin >> monthNumber;
} else {
cout << "Invalid input! Please enter a number between 1 and 12." << endl;
return 0;
Quiz no lab 4 A
#include <iostream>
int main() {
cout << "The area of the circle is: " << area << endl;
return 0;
B part
Solution quizes
#include <iostream>
int main() {
cout << "Temperature in Celsius: " << celsius << " C" << endl;
return 0;
Quiz no 4 b
#include <iostream>
int main() {
int choice;
cout << "1. Find the sum of two numbers" << endl;
cout << "2. Check if the numbers are even or odd" << endl;
} else if (choice == 2) {
if (num1 % 2 == 0) {
} else {
if (num2 % 2 == 0) {
} else {
} else {
return 0;