commit d647c5bd23f79b7b328f7da51d317161e40907cf
parent 00c4152a82e51768c00deaf35815cd79163652fa
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Wed, 8 Oct 2025 21:28:21 +0530
commit new file with add date to older
Diffstat:
28 files changed, 240 insertions(+), 0 deletions(-)
diff --git a/tuition-c/P001.c b/tuition-c/P001.c
@@ -1,4 +1,5 @@
//sample code
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P002.c b/tuition-c/P002.c
@@ -1,4 +1,5 @@
//sample code with a new line charecter
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P003.c b/tuition-c/P003.c
@@ -1,4 +1,5 @@
//WAP to perform addtion and multiplication of two integer numbers
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P004.c b/tuition-c/P004.c
@@ -1,5 +1,6 @@
/* WAP to find and display the value of given expression :
((x+3)/4) - ((2x+4)/3) taking the value of x = 5 */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P005.c b/tuition-c/P005.c
@@ -1,6 +1,7 @@
/* 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. */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P006.c b/tuition-c/P006.c
@@ -1,6 +1,7 @@
/* The normal temperature of human body
is 98.6 Degree Fahrenheit. WAP to convert the temperature
to Degree Celcius and display the output. */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P007.c b/tuition-c/P007.c
@@ -3,6 +3,7 @@ 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. */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P008.c b/tuition-c/P008.c
@@ -3,6 +3,7 @@ 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. */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P009.c b/tuition-c/P009.c
@@ -6,6 +6,7 @@ IMP : DA = 30% of Basic Pay
Gross Salary = Basic Pay + DA + HRA
Net Salary = Gross Salary - PF
*/
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P010.c b/tuition-c/P010.c
@@ -5,6 +5,7 @@ Hint : si = (p * r * t) / 100
a = p * ((1 + (r / 100)) ^ t)
ci = a - p
*/
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
#include<math.h>
diff --git a/tuition-c/P011.c b/tuition-c/P011.c
@@ -4,6 +4,7 @@ given by the formula :
WAP to calculate T take length(L) and gravity
as input
*/
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
#include<math.h>
diff --git a/tuition-c/P012.c b/tuition-c/P012.c
@@ -1,6 +1,7 @@
/* WAP to swap two integer variable without
using third variable */
// using Approch Mode : simple, slow, time consuming
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P013.c b/tuition-c/P013.c
@@ -1,6 +1,7 @@
/* WAP to swap two integer variable without
using third variable */
// using Approch Mode : complex, fast, less time consumimg
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
#include<math.h>
diff --git a/tuition-c/P014.c b/tuition-c/P014.c
@@ -1,6 +1,7 @@
/* WAP to accept the diagonal of
square. Find and display the area and
perimeter of the square. */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
#include<math.h>
diff --git a/tuition-c/P015.c b/tuition-c/P015.c
@@ -1,6 +1,7 @@
/*WAP to accept number of days and
display it after converting into
number of years, months and days */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
int main() {
diff --git a/tuition-c/P016.c b/tuition-c/P016.c
@@ -1,5 +1,6 @@
/* WAP to calculate and display radius of a
circle by taking the area as input */
+// Author - Amit Dutta, Date - Unknown
#include<stdio.h>
#include<math.h>
diff --git a/tuition-c/P017.c b/tuition-c/P017.c
@@ -1,4 +1,5 @@
/* Find maximum between three number. */
+// Author - Amit Dutta, Date - Unknown
#include <stdio.h>
int main()
diff --git a/tuition-c/P018.c b/tuition-c/P018.c
@@ -1,6 +1,7 @@
/* WAP to input the cost price and selling price and
calculate profit, profit percentage, loss percentage or
display the manage nither profit nor loss. */
+// Author - Amit Dutta, Date - Unknown
#include <stdio.h>
int main()
diff --git a/tuition-c/P019.c b/tuition-c/P019.c
@@ -6,6 +6,7 @@ the amount to be paid by the passanger.
next 10KM RS 10/KM
more than 25KM RS 9/KM
*/
+// Author - Amit Dutta, Date - Unknown
#include <stdio.h>
int main()
diff --git a/tuition-c/P020.c b/tuition-c/P020.c
@@ -6,6 +6,7 @@ taking the sum and number of days as input.
exact 365 days 9.0 %
more than 365 days 8.5 %
*/
+// Author - Amit Dutta, Date - Unknown
#include <stdio.h>
int main()
diff --git a/tuition-c/P021.c b/tuition-c/P021.c
@@ -0,0 +1,22 @@
+/* WAP to input a positive number and check if it is a perfect
+square number or not. */
+/* Author - Amit Dutta, Date - 8th OCT, 2025 */
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+
+#include <stdio.h>
+#include <math.h>
+int main()
+{
+ int n, temp;
+ double sr;
+ printf("Enter the number : ");
+ scanf("%d", &n);
+ sr = sqrt(n);
+ temp = (int)sr;
+ if (temp * temp == n)
+ printf("\nThis is a perfect square.");
+ else
+ printf("\nThis is not a perfect square.");
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P022.c b/tuition-c/P022.c
@@ -0,0 +1,16 @@
+/* WAP to find out smallest of three numbers without using if_else block. */
+/* Author - Amit Dutta, Date - 8th OCT, 2025 */
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+
+#include <stdio.h>
+int main()
+{
+ int a, b, c, min;
+ printf("Enter three number : ");
+ scanf("%d %d %d", &a, &b, &c);
+ min = (a < b && a < c) ? a : (b < a && b < c) ? b
+ : c;
+ printf("Minimum = %d", min);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P023.c b/tuition-c/P023.c
@@ -0,0 +1,23 @@
+/* WAP to input the total cost and compute the amount to be paid
+by the customer. */
+/* Author - Amit Dutta, Date - 8th OCT, 2025 */
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+
+#include <stdio.h>
+int main()
+{
+ double cost, amt;
+ printf("Enter the total cost : ");
+ scanf("%lf", &cost);
+ if (cost <= 2000)
+ amt = cost * 0.94;
+ else if (cost > 2000 && cost <= 5000)
+ amt = cost * 0.9;
+ else if (cost > 5000 && cost <= 10000)
+ amt = cost * 0.85;
+ else if (cost > 10000)
+ amt = cost * 0.8;
+ printf("\nAmount to be paid : %g", amt);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P024.c b/tuition-c/P024.c
@@ -0,0 +1,19 @@
+/* WAP to check whether a year is leapyear or not. */
+/* Author - Amit Dutta, Date - 8th OCT, 2025 */
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+
+#include <stdio.h>
+int main()
+{
+ int year;
+ printf("Enter the year : ");
+ scanf("%d", &year);
+ if (year % 4 == 0 && year % 100 != 0)
+ printf("\nYear %d is a leapyear.", year);
+ else if (year % 400 == 0)
+ printf("\nYear %d is a leapyear (Century).", year);
+ else
+ printf("\nYear %d is not a leapyear.", year);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P025.c b/tuition-c/P025.c
@@ -0,0 +1,30 @@
+/* WAP to input the electricity unit consumed and calculate the total
+bill amount according to the given condition :
+ for 1st 50 unit Rs. 0.50 per unit
+ next 100 unit Rs. 0.75 per unit
+ next 100 unit Rs. 1.20 per unit
+ above 250 unit Rs. 1.50 per unit
+And additional charge of 20 percent is added to the bill.
+*/
+/* Author - Amit Dutta, Date - 8th OCT, 2025 */
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+
+#include <stdio.h>
+int main()
+{
+ double unit, amt;
+ printf("Enter the electricity consp(unit) : ");
+ scanf("%lf", &amt);
+ if (unit <= 50)
+ amt = unit * 0.50;
+ else if (unit > 50 && unit <= 50)
+ amt = 25 + ((unit - 50) * 0.75);
+ else if (unit > 150 && unit <= 250)
+ amt = 25 + 75 + ((unit - 150) * 1.20);
+ else if (unit > 250)
+ amt = 25 + 75 + 120 + ((unit - 250) * 1.50);
+ amt = amt * 1.20;
+ printf("\nAmount to be paid : %g", amt);
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P026.c b/tuition-c/P026.c
@@ -0,0 +1,36 @@
+/* WAP to input sum (p), rate of interest (r), time (t) and type of interest
+('s' for simple interest amd 'c' for compound interest). Calculate and display
+the interest earned
+ si = (p * r * t) / 100
+ compoundInterest = p * ((1 + r / 100)^t - 1)
+*/
+/* Author - Amit Dutta, Date - 8th OCT, 2025 */
+
+#include <stdio.h>
+#include <math.h>
+#include <ctype.h>
+int main()
+{
+ double principalAmount, rateOfInterest, timePeriod, simpleInterest, compoundInterest;
+ char mode;
+ printf("Enter the principle amount, Rate of interest, Time : ");
+ scanf("%lf %lf %lf", &principalAmount, &rateOfInterest, &timePeriod);
+ printf("\nEnter the mode ('s' : simple interest, 'c' : compound interest) : ");
+ scanf(" %c", &mode);
+ mode = tolower(mode);
+ switch (mode)
+ {
+ case 's':
+ simpleInterest = (principalAmount * rateOfInterest * timePeriod) / 100;
+ printf("\nSimple Interest : %g", simpleInterest);
+ break;
+ case 'c':
+ compoundInterest = principalAmount * (pow((1 + rateOfInterest / 100), timePeriod) - 1);
+ printf("\nCompound Interest : %g", compoundInterest);
+ break;
+ default:
+ printf("\nInvalid Input");
+ return 1;
+ }
+ return 0;
+}+
\ No newline at end of file
diff --git a/tuition-c/P026.exe b/tuition-c/P026.exe
Binary files differ.
diff --git a/tuition-c/P027.c b/tuition-c/P027.c
@@ -0,0 +1,67 @@
+/* Purchase Discount on Discount on
+ Amount Laptop Desktop
+ -------- ----------- -----------
+ Upto 20k 3.0% 5.0%
+ 20001 - 50k 5.0% 7.5%
+ 50001 - 75k 7.5% 10.5%
+ more than 75k 10.0% 15.0%
+WAP to input amount of purchase and type of purchase ('L' : laptop, 'D' : desktop)
+and display the discount amount and the discounted price (Net Amount).
+*/
+/* Author - Amit Dutta, Date - 8th OCT, 2025 */
+// This code has not been compiled.
+// If you find any issues, please create a new issue on GitHub regarding them.
+
+#include <stdio.h>
+#include <ctype.h>
+int main()
+{
+ double principal_amount, desktop_discount, laptop_discount, discount_amount, discounted_price;
+ char choice;
+ printf("Enter the purchase amount : ");
+ scanf("%lf", &principal_amount);
+ printf("Type of purchase ('L' : Laptop, 'D' : Desktop) : ");
+ scanf(" %c", &choice);
+ choice = toupper(choice);
+ if (principal_amount <= 20000)
+ {
+ laptop_discount = 0.03;
+ desktop_discount = 0.05;
+ }
+ else if (principal_amount > 20000 && principal_amount <= 50000)
+ {
+ laptop_discount = 0.05;
+ desktop_discount = 0.075;
+ }
+ else if (principal_amount > 50000 && principal_amount <= 75000)
+ {
+ laptop_discount = 0.075;
+ desktop_discount = 0.105;
+ }
+ else if (principal_amount > 75000)
+ {
+ laptop_discount = 0.1;
+ desktop_discount = 0.15;
+ }
+ switch (choice)
+ {
+ case 'L':
+ discount_amount = principal_amount * laptop_discount;
+ discounted_price = principal_amount - discount_amount;
+ printf("\nDiscount Amount : %g"
+ "\nDiscounted Price : %g",
+ discount_amount, discounted_price);
+ break;
+ case 'D':
+ discount_amount = principal_amount * desktop_discount;
+ discounted_price = principal_amount - discount_amount;
+ printf("\nDiscount Amount : %g"
+ "\nDiscounted Price : %g",
+ discount_amount, discounted_price);
+ break;
+ default:
+ printf("\nInvalid Input.");
+ return 1;
+ }
+ return 0;
+}+
\ No newline at end of file