السلام عليكم الي يقدر يساااعدني عندي وااجب
ولازم اسلمه باااجر الساعه 10
حطيتة في فايل
بليييز
والله يعطيه العااافيه
عرض للطباعة
السلام عليكم الي يقدر يساااعدني عندي وااجب
ولازم اسلمه باااجر الساعه 10
حطيتة في فايل
بليييز
والله يعطيه العااافيه
حل Q1:
#include<stdio.h>
#include<conio.h>
void square();
void rectangle();
void main()
{
float side,width,height;
int choice;
clrscr();printf("caluculation of area,perimeter of squre and rectangle :\n\n");
printf("\n acept choice \n\n 1. square \n\n2. rectangle:\n");
printf("\n\n\enter choice:");
scanf("%d",&choice);
if(choice ==1
{
square();
}
else
{
rectangle();
}
getch();
}
void square()
{
float side,area,perimeter;printf("enter side of the square;\n");
scanf("%f",&side);area=side*side;perimeter=4*side;printf("\nArea is= %f \t Perimeter is=%f",area,perimeter);
} void rectangle()
{ float width, height,area,perimeter;printf("enter width and height of the square;\n");
scanf("%f%f",&width,&height);
area=width*height;
perimeter=2*(width+height);printf("\nArea is= %f \t Perimeter is=%f",area,perimeter);
}
سأمعن النظر في السؤأل الثاني