bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

commit 82390a1594c03e26201ea15e7e98e0838d963a38
parent 4a3ca6ae8af28bc9afb112d26e73e1b4c05a86f9
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Mon,  8 Sep 2025 21:37:47 +0530

Add files via upload
Diffstat:
Atution-c/P1.c | 7+++++++
Atution-c/P2.c | 7+++++++
Atution-c/P3.c | 15+++++++++++++++
Atution-c/P4.c | 10++++++++++
Atution-c/P5.c | 14++++++++++++++
Atution-c/P6.c | 11+++++++++++
Atution-c/P7.c | 16++++++++++++++++
Atution-c/P8.c | 18++++++++++++++++++
8 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/tution-c/P1.c b/tution-c/P1.c @@ -0,0 +1,7 @@ +//sample code + +#include<stdio.h> +int main() { + printf("Hello world"); + return 0; +} diff --git a/tution-c/P2.c b/tution-c/P2.c @@ -0,0 +1,7 @@ +//sample code with a new line charecter + +#include<stdio.h> +int main() { + printf("Hello\nworld"); + return 0; +} diff --git a/tution-c/P3.c b/tution-c/P3.c @@ -0,0 +1,15 @@ +//WAP to perform addtion and multiplication of two integer numbers + +#include<stdio.h> +int main() { + int a, b, sum, multi; + printf("Enter the 1st number : "); + scanf("%d",&a); + printf("Enter the 2nd number : "); + scanf("%d",&b); + sum = a + b; + multi = a * b; + printf("\nSum = %d" + "\nMultiplication = %d",sum,multi); + return 0; +} diff --git a/tution-c/P4.c b/tution-c/P4.c @@ -0,0 +1,10 @@ +/* WAP to find and display the value of given expression : +((x+3)/4) - ((2x+4)/3) taking the value of x = 5 */ + +#include<stdio.h> +int main() { + double x =5, result; + result = ((x + 3) / 4) - ((2 * x + 4) / 3); + printf("Result = %lf",result); + return 0; +} diff --git a/tution-c/P5.c b/tution-c/P5.c @@ -0,0 +1,14 @@ +/* A person is paid Rs. 455 for each day he works and fined +Rs. 150 for each day he remains absent. WAP to calculate his +monthly income taking the number of days present as input. */ + +#include<stdio.h> +int main() { + int daily_wage = 455, fine = 150, present, absent, income; + printf("No of days present : "); + scanf("%d", &present); + absent = 30 - present; + income = (present * 455) - (absent * 150); + printf("\nIncome : %d",income); + return 0; +} diff --git a/tution-c/P6.c b/tution-c/P6.c @@ -0,0 +1,11 @@ +/* The normal temperature of human body +is 98.6 Degree Fahrenheit. WAP to convert the temperature +to Degree Celcius and display the output. */ + +#include<stdio.h> +int main() { + double f = 98.6, c; + c = ((f - 32) * 5) / 9; + printf("Temperature in Celcius is : %lf",c); + return 0; +} diff --git a/tution-c/P7.c b/tution-c/P7.c @@ -0,0 +1,16 @@ +/* A shopkeeper offers 10% discount on printed +price of a digital camera. However a customer has +to pay 6% GST on the remaining amount. WAP to +calculate and display the amount to paid by the +customer, taking the printed price as input. */ + +#include<stdio.h> +int main() { + double mrp, final_price, temp; + printf("Enter the printed price : "); + scanf("%lf", &mrp); + temp = mrp * 0.90; + final_price = temp * 1.06; + printf("\nCustomer have to pay : %lf", final_price); + return 0; +} diff --git a/tution-c/P8.c b/tution-c/P8.c @@ -0,0 +1,18 @@ +/* A shopkeeper offers 30% discount on purchasing an +item whereas the other shopkeeper offers 2 successive +discount of 20% and 10% for purchasing the same item. +WAP to caompute and display the discounted price of the +item by taking the price as input. */ + +#include<stdio.h> +int main() { + double mrp, shop1, shop2, temp; + printf("Enter the price : "); + scanf("%lf", &mrp); + shop1 = mrp * 0.70; + temp = mrp * 0.80; + shop2 = temp * 0.90; + printf("\nShopkeeper 1 price : %lf" + "\nShopkeeper 2 price : %lf",shop1,shop2); + return 0; +}
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror