C program to calculate area or perimeter of a rectangle by using switch case.
Answers
Answered by
2
Answer:
okkkkkkkkkkkkkkkkkkkkkkk
Answered by
1
C Program to Calculate the area of Rectangle using Switch case
#include<stdio.h>
int main()
{
int choice, radius, length, breadth, side;
float area;
printf("\n Press 1 to calculate area of Rectangle \n Press 2 to Exit");
printf("\n Enter your choice:");
scanf("%d",&choice);
switch(choice)
{
case 1: printf("\n Enter length:");
scanf("%d",&length);
printf("\n Enter breadth:");
scanf("%d",&breadth);
printf("\n Area of rectangle: %d",length*breadth);
break;
case 2: return 0;
default: printf("\n wrong choice");
}
return 0;
}
Similar questions
Math,
30 days ago
Biology,
30 days ago
Math,
30 days ago
Computer Science,
2 months ago
English,
9 months ago