#include #include #include #include #define MAXSIZE 200 // int imnotallowedvar = 50; int fred(int value); int george(int val); int main(void) { float barney; short a, b, c; int d = 0, po2 = pow(2,3); b = 32670; c = b; a = b+ c; d = b + c; printf("a is sum of b and c = %hd, b = %hX, c = %hX, maxshrt = %X or %d, \n d= %X or %d, max int = %d\n", a,b,c,SHRT_MAX,d, INT_MAX); /* printf("Hi! I'm po2 from pow %d \n",po2); barney = 6; //fred(4); printf("Barney is %f\n",barney); george((int)barney); */ return 0; } int fred(int value) { int wvalue = MAXSIZE; int dvalue = 0; printf("Wilma is %d\n",wvalue); /* Commenting out the next two lines for testing */ wvalue++; // += 1; printf("Wilma is %d\n",wvalue); wvalue = 0; // *= (3 + 7); // wv * 3 + 7 or wv * (3 + 7) printf("Wilma is %d before if \n",wvalue); if (wvalue <= 50) { printf("How old is Wilma? (Please enter an integer less than 21) "); scanf("%d",&wvalue); if (wvalue < 21) printf("Good job!"); else while (wvalue >= 21) { printf("Please follow the instructions. Re-enter a number < 21: "); scanf("%d",&wvalue); } } else if (wvalue < 100) { if ((54 < wvalue) && (wvalue < 62)) { printf("Wilma is an odd old bat\n\n"); } else { printf("Wilma is an even older bat\n\n"); } } else { printf("Wilma is ancient\n\n"); } printf("Wilma is %d\n",wvalue); printf("Fred says he is %d and Wilma is %d \n",value,wvalue); value += ++wvalue; dvalue = 2*value; printf("Now Fred says he is %d and Wilma is %d and Dino is %d\n",value,wvalue,dvalue); return wvalue; } int george(int val) { int jane, elroy, judy, astro, c; printf("\nPlease enter 4 integers seperated by spaces: "); scanf("%d %d %d %d",&jane, &elroy, &judy, &astro); printf("\nYou entered %d, %d, %d, and %d\n",jane, elroy, judy, astro); // for c in range(1,11): Python for (c = jane ; c < astro++ ; judy +=3 ) { judy++; printf("c is %d and astro is %d and judy is %d\n",c, astro, judy); c += 4; } }