Posts

Simple interest

 #include <stdio.h> int main() {     int principal, rate, time, simpleInterest;      printf("Enter the principal amount: ");     scanf("%d", &principal);     printf("Enter the rate of interest (%): ");     scanf("%d", &rate);      printf("Enter the time period (in years): ");     scanf("%d", &time);      simpleInterest = (principal * rate * time) / 100;      printf("Simple Interest: %d\n", simpleInterest);      return 0; }

Compound interest

 #include <stdio.h> #include <math.h>  int main() {     double principal, rate, time, amount, compoundInterest;      printf("Enter the principal amount: ");     scanf("%lf", &principal);     printf("Enter the interest rate (%): ");     scanf("%lf", &rate);     printf("Enter the time period (years): ");     scanf("%lf", &time);     // Calculate compound interest     amount = principal * pow(1 + rate / 100, time);     compoundInterest = amount - principal;      printf("Compound Interest: %.2lf\n", compoundInterest);      return 0; }

Area of circle

 #include <stdio.h> int main() {    // declaring the variables radius and area    float radius, area;    // initializing the value of pi    float pi = 22.0 / 7.0;    // taking the user input    printf("Enter the radius of the circle: ");    scanf("%f", &radius);     // calculating the area    area = pi * radius * radius;    // printing the area    printf("The area of the circle is %f", area);    return 0; }

Triangles area

 #include <stdio.h> #include <math.h> void main() {          float a, b, c, s, area;          printf("Enter side a: ");     scanf("%f", &a);          printf("Enter side b: ");     scanf("%f", &b);          printf("Enter side c: ");     scanf("%f", &c);     s = (a + b + c) / 2;     area = sqrt((s *(s - a) *(s - b) *(s - c)));     printf("\n The area of the triangle is %f.", area); }

Marksheet

 #include<stdio.h> #include<stdlib.h> int main() {   int biology, physics, english, chemistry, computer;   char name[30];   printf("Enter your name:");   scanf(" %s", name);   printf("Enter marks of biology:");   scanf("%d", &biology);   printf("Enter marks of physics:");   scanf("%d", &physics);   printf("Enter marks of english:");   scanf("%d", &english);   printf("Enter marks of chemistry:");   scanf("%d", &chemistry);   printf("Enter marks of computer:");   scanf("%d", &computer);   printf("===================================================\n");   printf("MARKSHEET OF STANDARD 12\n");   printf("---------------------------------------------------\n");   printf("SUBJECT\t\t\t\t\tMARKS\n");   printf("---------------------------------------------------\n");   printf("Biology\t\t\t\...