0% found this document useful (0 votes)
11 views4 pages

RemovePagesResult 2023 11 20 02 32 42

This document contains two C programs - one to calculate the area of a circle given its radius, and another to calculate simple interest given the principal amount, interest rate, and time. For each program, the aim, algorithm, program code, sample output, and result are provided. The circle area program takes user input for radius, calculates area using the formula, and prints the result. The simple interest program similarly takes inputs for principal, rate, and time, calculates interest using the formula, and prints the output. Both programs are verified to produce the correct outputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

RemovePagesResult 2023 11 20 02 32 42

This document contains two C programs - one to calculate the area of a circle given its radius, and another to calculate simple interest given the principal amount, interest rate, and time. For each program, the aim, algorithm, program code, sample output, and result are provided. The circle area program takes user input for radius, calculates area using the formula, and prints the result. The simple interest program similarly takes inputs for principal, rate, and time, calculates interest using the formula, and prints the output. Both programs are verified to produce the correct outputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

KEVIN K R #FMT

Ex.no: 1 Program comprising of I/O statements,


Date:
operators and expressions

Ex.no: 1(A): AREA OF CIRCLE

AIM:
To write a C Program for finding the area of a Circle.

ALGORITHM:
Step 1: Start the program.
Step 2: Include the header files.
Step 3: Assign required variables namely r, a.
Step 4: Obtain the input value for r (radius).
Step 5: Calculate the area by using the formula a=3.14 x r x r.
Step 6: Print the result value.
Step 7: Stop the Program.

PROGRAM:
#include<stdio.h>
#include<conio.h>
void main()
{
int r;
float a;
clrscr();
printf("Enter the value of Radius:");
scanf("%d",&r);
a=3.14*r*r;
printf("The Area of the Circle is:%f",a);
getch();
}

22UCS102 - PROGRAMMING IN C LABORATORY


KEVIN K R #FMT

OUTPUT:
Enter the value of Radius:
14
The Area of the Circle is: 615.440002.

RESULT:
Thus, the C program for finding the area of circle is executed and the output is verified successfully.

22UCS102 - PROGRAMMING IN C LABORATORY


KEVIN K R #FMT

Ex.no: 1(B): SIMPLE INTEREST CALCULATION

AIM:
To write a C Program to perform a Simple Interest Calculation.

ALGORITHM:
Step 1: Start the program.
Step 2: Include the header files.
Step 3: Assign required variables namely, p, r, t, a.
Step 4: Get the input values of p, r, t (principal amount, rate of interest and time respectively).
Step 5: Calculate the Simple Interest by using the formula (p x r x t)/100.
Step 6: Print the result value.
Step 7: Stop the Program.

PROGRAM:
#include<stdio.h>
#include<conio.h>
void main()
{
float p,r,t,a;
clrscr();
printf("Enter the value of Principal amount:");
scanf("%f",&p);
printf("Enter the Rate of Interest:");
scanf("%f",&r);
printf("Enter the Time value:");
scanf("%f",&t);
a=(p*r*t)/100;
printf("Simple Interest:%f",a);
getch();
}

22UCS102 - PROGRAMMING IN C LABORATORY


KEVIN K R #FMT

OUTPUT:
Enter the value of Principal amount: 1200
Enter the Rate of Interest : 4
Enter the Time value: 5
Simple Interest: 240.000000

RESULT:
Thus, the C program for determining the Simple Interest is executed and the output is verified successfully.

22UCS102 - PROGRAMMING IN C LABORATORY

You might also like