Question: Due: Jan 20, Thursday, 2022, 11:30pm After creating your program you should be able to compile and run it in the Developer Command Prompt for

Due: Jan 20, Thursday, 2022, 11:30pm After creating your program you should be able to compile and run it in the "Developer Command Prompt for VS 2019" (or some other version). Make your program portable by using standard library functions or features but not using any platform specific features. For example, scanfs is a function specific to the Microsoft cl compiler so you should avoid using this function. Gradescope will use the gec compiler to compile your programs. Throughout the semester your homework programming solution files should be portable in this way. 1. (5Opts) Write a C program Alpic to print out 15 lines of messages as shown in the following. Be sure not to write printf 15 times. Instead, use for, while, or do..while loops to achieve the result. Each line from the second on has one more space than the previous line between "hello" and "world". Also, every other line has an exclamation point at the end of the line. [kwang computer) t-/temp]$ ./Alpi hello world hello world! hello world hello world! hello world holle world hello world helle world! hollo world holle world hello world bole world! hello world helle world! hello world 2. (5Opts) Write a C program Alp2.c to read from stdin as many lines of input as possible (each line can be assumed to be an integer). Do not use an infinite loop without a break and do not force the user. to type a special number (20) to indicate the end of inputs. (Hint: one possible way to achieve this is to check the return value of scanf function to break out of a loop.) The program should print the square as each input number is received. A sample run can look like the following (note that number of input integers and the integers themselves can be arbitrary so do not assume there will be four input integers): [twang computert-/temp) $ ./A1p2 Enter some integers: 2 hello world 2. (5Opts) Write a C program Alp2.c to read from stdin as many lines of input as possible (each line can be assumed to be an integer). Do not use an infinite loop without a break and do not force the user te tyre a special number (e.g. 0) to indicate the end of inputs (Hint: one possible way to achieve this is to check the return value of scanf function to break out of a loop.) The program should print the square as each input number is received. A sample run can look like the following (note that number of input integers and the integers themselves can be arbitrary so do not assume there will be four Input integers): [kwang computer-/temp]$ ./A1p2 Enter some integers: 1 The square of 1 is 1. 2 The square of 2 is 4. The square of -3 is 9. 52 The square of 5 is 25. if you run the program with standard input redirection, a sample run can look like the following (assuming the text file someintegers.txt contains the four integers 1,2,-3,5 on four separate lines): Ikwang@computer (-/temp]$ ./A1p2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
