Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- struct rectangle{
- double a;
- double h;};
- struct x_rectangle{
- struct rectangle rect;
- double rect_pole;};
- void oblicz_pole( struct x_rectangle *prostokat)
- {
- prostokat->rect_pole=prostokat->rect.a*prostokat->rect.h ;
- }
- int main(void)
- {
- struct x_rectangle prostokat;
- scanf("%lf %lf", &prostokat.rect.a,&prostokat.rect.h );
- oblicz_pole(&prostokat);
- printf("[a = %.2lf]*[h = %.2lf] = %.2lf" , prostokat.rect.a, prostokat.rect.h , prostokat.rect_pole);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement