This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/C19/ex1.c

21 lines
372 B
C
Raw Normal View History

2023-10-10 10:24:31 +00:00
#include <stdio.h>
struct Person {
int age;
char forename[30];
char surname[50];
};
int main() {
struct Person p;
printf("Enter age: "); scanf("%d", &p.age);
printf("Enter forename: "); scanf("%29s", p.forename);
printf("Enter surname: "); scanf("%49s", p.surname);
printf("p.age=%d p.forename=%s p.surname=%s\n", p.age, p.forename, p.surname);
return 0;
}