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