Question: 1) Write a C program to print the given X number pattern series. See examples below Your program should ask for a single input- the

1) Write a C program to print the given X number pattern series. See examples below Your program should ask for a single input- the number, which will be a digit from 1-9 (if the number is not within the range, the program will terminate, e.g. if the user enters 10, or -1, the program will terminate) and then output the number and in the line below, the corresponding X pattern onto a file. The output filename is *CP2.txt'. Please leave 2 lines in between successive outputs for clarity. Note the appearance of the X: your output must match the examples below. Also note that your code must not hard code the output corresponding to each individual number (1-9) but rather, be general (80 points) Example output: Input N: 4 1 1 2 2 33 4 33 2 2 1 1 Input N: 5 Input N: 5 1 1 2 2 3 44 5 4.4 33 2 2 1 1 2) Here, the user provides an array of characters that the programmer will show in an X pattern. The array can only be 1-9 characters long but can be any characters the user chooses. Again, see example below (20 points). Input !@#$ Output ! ! @ @ # # $ # # @ @ ! ! The characters will be stored in lines in an input file. Your input file is cp2.txt. You will read in the characters from the input file - the characters will be separated by white space. An example of an input file is below (the first line has 3 characters, so your output X will consist of those three characters, the 2nd line has four characters, so your output X will consist of those four characters): 2 el !@#$
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
