#include<stdio.h>
main()
{
int a,b;
float p,A;
printf("Enter the outer radius");
scanf("%d",&a);
printf("Enter the inner radius");
scanf("%d",&b);
p=2*3.14*(a+b);
A=3.14*(a*a-b*b);
printf("Perimeter=%f Area=%f",p,A);
}
1. Problem solving steps – writing algorithms and flowcharts.
main()
{
int a,b;
float p,A;
printf("Enter the outer radius");
scanf("%d",&a);
printf("Enter the inner radius");
scanf("%d",&b);
p=2*3.14*(a+b);
A=3.14*(a*a-b*b);
printf("Perimeter=%f Area=%f",p,A);
}
ASSIGNMENT NO 1)
TO DEMONSTRATE THE USE OF DATA TYPES, SIMPLE OPERATORS AND EXPRESSIONS
You should read following topics before starting this exercise
1. Problem solving steps – writing algorithms and flowcharts.
2. Different basic data types in C and rules of declaring variables in C.
3. Different operators and operator symbol.
4. How to construct expressions in C, operator precedence.
No comments:
Post a Comment