Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Arrays Grtade and Toppers
//gcc 4.9.3 #include <stdio.h> void Grade(int *p,int n) { int i; srand(getpid()); for(i=0;i<n;i++) { p[i]=rand()%101; printf("a[%d]=%d\n",i,p[i]); if(p[i]<35) printf("FAIL\n"); else if(p[i]>=35&&p[i]<50) printf("SECOND CLASS\n"); else if(p[i]>=50&&p[i]<70) printf("FIRST CLASS\n"); else printf("DISTINCTION\n"); } } void Highest(int *p,int n) { int i,max; max=p[0]; printf("***TOPPERS***\n"); for(i=0;i<n;i++) { if(p[i]>max) max=p[i]; } for(i=0;i<n;i++) { if(p[i]==max) printf("a[%d]=%d\n",i,max); } } main() { int a[20]; int n; n=sizeof(a)/sizeof(a[0]); Grade(a,n); Highest(a,n); }
run
|
edit
|
history
|
help
0
a.out
Binary example
muuchas funciones utiles
Bool datatype Operation for GCC
Array Struct, Call-By-Reference, Malloc, Free, Init, Destroy ... Example
Atleti
Singly LinkedList.c
B_141121_factorial01
Goodone pointer minus void pointer
888 BONUS LAB 1