المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : والي يرحم والديكم ساعدوني بلييز



العين مون
17-12-2011, 12:55 AM
السلام عليكم الي يقدر يساااعدني عندي وااجب
ولازم اسلمه باااجر الساعه 10

حطيتة في فايل



بليييز

والله يعطيه العااافيه

The State 0f paRadise
17-12-2011, 08:39 PM
حل 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);
}




سأمعن النظر في السؤأل الثاني