Computer Science, asked by mikixettri, 2 months ago

C program to calculate area or perimeter of a rectangle by using switch case. ​

Answers

Answered by sanchitamandal236
2

Answer:

okkkkkkkkkkkkkkkkkkkkkkk

Answered by shahegulafroz
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