Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The learning objectives of the program are: Write a complete program. Use loops and conditional statements. Use printf and scanf to perform 10. Program Specification
The learning objectives of the program are: Write a complete program. Use loops and conditional statements. Use printf and scanf to perform 10. Program Specification The entire program must be written in a single source code file, named intprops.c. The program will ask the user to enter a number, which must be greater than zero. If zero is entered, the program quits. If the number is negative, the prompt is repeated. The prompt message and the error message must look exactly like the example below. (Characters typed by the user are highlighted in gray. It won't look like this on the console, of course, but the highlighting is done here to emphasize what is entered by the user.) Enter a non-zero positive integer: 13 NOTE: You may assume that the user will type exactly one decimal number, followed by linefeed (Enter) in response to the base prompt. It may be an illegal number, but it will be a number. Your program does not need to deal with a non-integer input. Do not use commas in the input. The input may have leading zeroes, which will be ignored. Once an acceptable number has been entered, the program will skip one line and then print several questions and answers regarding properties of the number. These properties are discussed in detail below. The questions and answers must match exactly the specification. Here is an example output using the input value of 13 as shown above. Is the number even? No Is the number prime? Yes Is the number a perfect square? No How many bits? 4 How many ones? 3 How many decimal digits? 2 What is the reverse of the input number: 31 Pay careful attention to the format of the output. There are two spaces after the question mark. There is no space or punctuation after the answer to the question, just a linefeed. Each question is on a single line, with no empty lines between questions. After the properties have been printed, the program skips a line and prompts for a new number. This continues until the user enters zero, and the program exits. Details: Questions and Answers This section shows each of the questions that the program must answer, as well as the format of the answers. Follow the formatting shown above -- two spaces after the question mark, no space or punctuation after the answer. The answer must be on the same line as the question, and there must be no skipped lines. Use exactly the same words and capitalization shown below. You are not allowed to use any standard library functions (except for printf and scanf) in the implementation of your code. In particular, do not use sqrt, pow, or any other function in math.h. You may only use integer operators. If you ignore this rule, you will lose points
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