Question: Read the zipcode from the user as an integer number, then get the digits from the zipcode and print them one by one. For
\
Read the zipcode from the user as an integer number, then get the digits from the zipcode and print them one by one. For instance, if the user inputs 48126 the output should be: 4 8 1 2 6
Start here X Hw207.c X 1 int main (void) { 2 int zipcode; 3 int arr [MAX]; 4 int i=0; 5 int j, r; 6 printf("please enter zincode :"); 7 scanf("%d", &zipcode); 8 while (zipcode !=0); { 9 r=zipcode $10; 10 arr[i]=r; 11 i++; 12 zipcode=zipcode/10; 13 FB 14 printf(" "); 15 for (j=i 1; j>-1; j--) { 16 printf("%d", arr[j]); 17 printf(" "); 18 FB 19 return 0 : 20 } 21 Logs & others Code::Blocks X Search results X Cocc X Build log X Build messages x CppCheck/Vera++ X CppCheck/Vera++ messag File Line Message 3 D:\coding HW D:\coding HW D:\coding HW D:\coding HW === Build file: "no target" in "no project" (compiler: unknown) In function 'main': error: "MAX' undeclared (first use in this function) note: each undeclared identifier is reported only once for each function it appears in warning: implicit declaration of function 'print' [-Wimplicit-function-declaration) 3 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
