Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //DECLARACION DE UN NUEVO TIPO DE DATO
- typedef struct punto
- {
- int x,y;
- } puntito;
- typedef struct circunferencia
- {
- puntito centro;
- float radio;
- } circunferencia;
- int main()
- {
- circunferencia c1,*c2;
- c1.centro.x=1;
- c1.centro.y=1;
- c1.radio=5;
- c2 = &c1;
- //leer el centro de la circunferencia
- scanf("%d%d", &c1.centro.x,&c1.centro.y);
- scanf("%f", &c1.radio);
- printf("centro = (%d,%d) y radio = %f\n",c2->centro.x,c2->centro.y,c2->radio);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement