GNG 1106 Study Guide - Midterm Guide: C String Handling, Scanf Format String, Hypotenuse

151 views15 pages

Document Summary

Logical expression prototype return if-else: void, num = rand()%10, char *str; 456: its value, the nul character, \0". Its decimal value is 0. if(x > 3) for (i=5;i>0;i=i-1) if(x==3) else printf( x is greater than 3\n ); printf( x is less than 3\n ); int main() int i; for (i=5,i>0,i=i-1); printf( %d , i); return(0); #include n = 1; while(n >= 5) int main () int array (5) = {1, 2, 7, 4, 12}; int n, result=0; /* sum the elements of the array */ n = 0 while(n < 5) result = result + array[n]; printf( sum is %f , result); printf("sum is %d", result); return (0); result = result + array(n); n = n + 1; 1 a[2] >= z && y <= a[0] True w + x/2 (a[4]+5. 1) >= 6. 5 || a[1] != y w<=x != y<=z: #define long_number 12345678901234567890. False typedef struct char identifier[max_str_size+1]; // +1 to accommodate "\0" int numpoints;