0% found this document useful (0 votes)
7 views

Lab Task 12

Uploaded by

Haris Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lab Task 12

Uploaded by

Haris Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Haris Nazir Medical Physics 2024-26 CF-II Assignment

-------------------------------------------------------------------------------------

Q1. Write a c program to calculate your income tax (you enter your income and it outputs the
payable tax).

#include <stdio.h>

int main() {
float sal, tax;

printf("Enter your salary in Rupee: ");


scanf("%f", &sal);

if (sal >= 600000 && sal <= 1200000) {


tax = (sal * 0.05) + 20000;
printf("Your Payable Tax amount is: Rs:%.2f", tax);
} else if (sal >= 1200000 && sal <= 2200000) {
tax = ((sal - 1200000) * 0.15) + 30000;
printf("Your Payable Tax after tax deduction is: %.2f", tax);
} else if (sal >= 2200000 && sal <= 3200000) {
tax = ((sal - 2200000) * 0.20) + 180000;
printf("Your Payable Tax after tax deduction is: %.2f", tax);
} else if (sal >= 3200000 && sal <= 4100000) {
tax = ((sal - 3200000) * 0.25) + 430000;
printf("Your Payable Tax after tax deduction is: %.2f", tax);
} else if (sal >= 4100000) {
tax = ((sal - 4100000) * 0.35) + 700000;
printf("Your Payable Tax after tax deduction is: %.2f", tax);
} else {
printf("Invalid salary input.");
}

return 0;
}
OUTPUT:
Q2. Write a C program that takes integer values from 1-7 and displays your time table for that
particular day.

#include <stdio.h>

int main() {
int day;

printf("Time Table:\nEnter the relevant integer \nFor Monday: \t 1\nFor


Tuesday:\t 2\nFor Wednesday: \t 3\nFor Thursday:\t 4\nFor Friday: \t
5\nFor Saturday:\t 6\nFor Sunday: \t 7\n");
scanf("%d", &day);

switch (day) {
case 1:
printf("\nMonday: \n8:25-9:20: INST\n9:30-10:25: MM\n10:35-11:30:
EM\n11:40-12:35: CF-II\n1:30-3:25: Tutorial (INST)\n");
break;
case 2:
printf("Tuesday: \n8:25-9:20: MM\n9:30-10:25: CCB\n10:35-11:30:
AM\n11:40-12:35: -\n1:30-3:25: CCB \n");
break;
case 3:
printf("Wednesday: \n8:25-9:20: -\n9:30-10:25: EM\n10:35-11:30: CF-
II\n11:40-12:35: -\n1:30-3:25:CCB\n");
break;
case 4:
printf("Thursday: \n8:25-9:20: -\n9:30-10:25: MM\n10:35-11:30: EM\n11:40-
12:35: CCB\n1:30-3:25: Tutorial (CF-II)\n");
break;
case 5:
printf("Friday: \n8:25-9:20: INST\n9:30-10:25: CF-II (Lab)\n10:35-11:30:
CF-1\n11:40-12:35: -\n1:30-3:25: -\n");
break;
case 6:
printf("\nSaturday:\nYou have no class Today");
break;
case 7:
printf("\nSunday:\nYou have no class Today");
break;

default:
printf("Invalid input. Please enter a number between 1 and 7.\n");
}

return 0;
}

OUTPUT:

You might also like