Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Function practice
//gcc 5.4.0 /* C has two ways to list function, before main, after main prototypes by reference by value #include <stdio.h> int findMax(int a,int b){ if (a <b) return (b); else return (a); } int main(void) { int x =5; int y = 10; printf ("Max of %d and %d is %d\n", x, y, findMax(x,y)); x = 100; y = -1; printf ("Max of %d and %d is %d\n", x, y, findMax(x,y)); return 0; } */ /* #include <stdio.h> int sumaray(int myparam[], int limit){ int i; int sum=0; for(i=0; i < limit; ++i) sum += myparam[i]; return (sum); } void main(void) { int myarr1[5] = {1,2,3,4,5}; int myarr2[8] = {1,2,3,4,5,6}; printf ("sum=%d\n", sumaray(myarr1, 5)); printf ("sum=%d\n", sumaray(myarr2, 8)); } #include <stdio.h> double square(double a){ double base; base = a*a; return(base); } double volume(double b, double h){ double vol; vol=b*h/3; return(vol); } int main(void){ double a=7.7; double h=3.8; double v; v = volume(square(a),h); printf("volume is %lf\n", v); return 0; } #include <stdio.h> double square(double a){ return (a*a); } double volume(double height, double length){ return (square(length)*height/3.0); } int main(void) { double height = 4; double length = 5.3; printf("%lf",volume(height,length)); return 0; } */
run
|
edit
|
history
|
help
0
Area
Official Hello World
Lab 11
SEGUNDO AVANCE DE NETFLIX
Finding the second largets value v0.8
Calculating longs p v1
A_141201_MatrizTodosDistintos
Test 4
pointer example 2
ForU