Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions: 1. Submit 10 Problem#.c files containing executable code [20% points] 2. Submit 1 word doc file (for all problems) containing: a) Problem and sub-problem
Instructions: 1. Submit 10 Problem#.c files containing executable code [20% points] 2. Submit 1 word doc file (for all problems) containing: a) Problem and sub-problem description (10% points] b) Solution [20% points] c) Code comments (descriptive), proper code indentation, blocks and debugging [20% points] d) Output Snapshot (PrntScrn), by running it on at least 2 valid & 1 invalid input. [30% points] Question 1: Write a C Program that uses nested loops to produce a NX N (square) matrix A with O's in the diagonal, 1's in the entries just above and below the diagonal element, 2's above and below that, and so on. The 5 x 5 matrix should look like this: 1 2 3 4 0 1 2 3 1 0 1 2 2 1 1 3 2 1 0 0 1 2 3 4 Om m NO NO Question 2: Write a C Program to print all first N elements of binary numbers series. For N = 3, output is 0,1,10 For N = 5, output is 0,1,10, 11, 100 Question 3: Write a C Program to print all first N elements of prime numbers series. For N = 4, output is 2, 3, 5, 7 For N = 6, output is 2, 3, 5, 7, 11, 13 Question 4: Write a C Program to print out all of the factors of a number from 1 to N. For N = 9, output is 1, 3,9 For N = 7, output is 1,7 Question 5: Write a C Program to calculate the power of a number, given the number and the exponent. Example: Enter Number: 2 Enter Power: 4 Result: 16 Question 9: Multiply all the digits of a number n by each other, repeating with the product until a single digit is obtained. The number of steps required is known as the multiplicative persistence, and the final digit obtained is called the multiplicative digital root of n. For example, the sequence obtained from the starting number 9876 is (9876, 3024, 0), so 9876 has a multiplicative persistence of two and a multiplicative digital root of 0. Write a C Program to for finding number persistency and multiplicative root of any positive integer n. Question 10: Write a program to count and print the number of small letters, capital letters, vowels and spaces in a sentence. It also prints the total length of the sentence. User can enter a full stop. To terminate the sentence. If the user enters any characters other than space or alphabets, it should not be displayed on the screen. (Hint: You may have to use getch() instead of getche() for the input)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started