Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
lab 12 v0.1
//gcc 5.4.0 #include <stdio.h> #include <string.h> #include <limits.h> //typedef struct{ // char first_name[20]; // char last_name[20]; // }name typedef struct{ char person_name[10]; int age; }person; int getoldest(person persons){ int Maxage=0; for(int i=0;i<N;i++){ if(persons[i].age>Max) Maxage=i; } printf("%d %s\n",persons[Maxage].age,persons[Maxage].person_name); return 0; } int main(void) { printf("Please input array size\n"); int N=0; scanf("%d",&N); person persons[N]; persons[0].age=10; persons[1].age=5; strcpy(persons[0].person_name,"Jacob"); strcpy(persons[1].person_name,"Jane"); getoldest(persons->age); return 0; }
run
|
edit
|
history
|
help
0
ECE 2574 1/23
lab5
hwkpractice
Matrix multiplication. C
KN king Array ques
strcmp
a
Part 1: Draw Arts
C_141113_euclides
child process