1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kiruha [24]
2 years ago
13

Write a program that takes in an integer in the range 10 to 100 as input. Your program should countdown from that number to 0, p

rinting the count each of each iteration. After ten numbers have been printed to the screen, you should start a newline. The program should stop looping at 0 and not output that value.
I would suggest using a counter to count how many items have been printed out and then after 10 items, print a new line character and then reset the counter.

important: Your output should use " %3d " for exact spacing and a space before and after each number that is output with newlines in order to test correctly.

Ex: If the input is: 10
the output is: 10 9 8 7 6 5 4 3 2 1

Ex: If the input is: 20
the output is: 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

For coding simplicity, follow each output number by a space, even the last one. statement.

Use a while loop. You will need to use an if statement and some sort of decremented variable in your loop.

The skeleton code given in C programming:

#include

int main(void) {
int userNum = 0;
int counter = 0;
printf("Enter a number between 10 and 100:\n");
scanf("%d", &userNum);
if (userNum >= 10 && userNum <=100)
{
while( )
{
/* your code here */
}
}
printf("\n");

return 0;
Computers and Technology
1 answer:
kumpel [21]2 years ago
7 0

Answer:

Program to perform above

Explanation:

#include <stdio.h>

int main() {

   int userNum = 0;

   int counter = 0;

   printf("Enter a number between 10 and 100:\n");

   scanf("%d", &userNum);

   if (userNum >= 10 && userNum <=100)

       {

       while(userNum > 0)

           {

               printf("%d\n", userNum);

               userNum--;

               

           }

       } else

       {

           printf("Number is out of range");

       }

printf("\n");

   

   return 0;

}

You might be interested in
URGENT!
lutik1710 [3]

<u>Explanation:</u>

Hey there! you need not to panic about it ,your program didn't have Driver program i.e main program! the correct & working code is given below:

// C++ program to count  even digits  in a given number .

#include <iostream>  

using namespace std;  

// Function to count digits

int countEven(int n)  

{  

int even_count = 0;    

while (n > 0)  

{  

 int rem = n % 10;  

 if (rem % 2 == 0)  

  even_count++;  

 n = n / 10;  

}  

cout << "Even count : "

 << even_count;  

if (even_count % 2 == 0 )  

 return 1;  

else

 return 0;  

}  

// Driver Code  

int main()  

{  

int n;  

std::cin >>n;

int t = countEven(n);  

return 0;  

}  

6 0
2 years ago
What did the strict study generally find about the effect of internet use on sleep?
rjkz [21]
A. should be the answer hope this helps :)
4 0
3 years ago
Read 2 more answers
Describe the concepts of confidentiality, integrity, and availability (C-I-A), and explain each of the seven domains of a typica
GREYUIT [131]

Answer:

Answer explained below. The remaining part of the question is incomplete

Explanation:

The concepts of confidentiality, integrity, and availability (C-I-A) can be explained in following given points.

1) Confidentiality: Its basically refer to the confidentiality of the information. Here we can think about the protection of the information from unauthorized person. Confidentiality enuser that at what level your information is secured and no unauthorized access will be done to the information. For maintaining the confidentiality, we can use various encryption methods. The main concept of confidentiality is to enforce various techniques like encryption, file permissions and access control to restrict access to important information.

2) Integrity: Integrity of the information refer to the unwanted modification of the information. Integrity of the data as well as the information should be maintained and only the autorized person can access as well as modify the information. For enforcing the integrity, we can implement various hashing techniques on information.

3) Availability: Availability refers to the availability of the information, when ever an autorized person requests for the information. High availability of the information should occur, so that any autorized person can access it, when ever its required. For high availability, we can create backup as well as replicate the data across the geo sites.

Seven domains of a typical IT infrastructure are given below:

1) User Domain: Its refer to the group of users as well as the person who access the information systems.

2) LAN Domain: Refer to the local area network, where various computers are connected to each other.

3) Workstation Domain: The area is called workstation, where various users connect to the IT infrastructure.

4) WAN and LAN link domain: Refer to the connection of local area network to wide area network.

5) WAN domain: Refer to the wide area network, connection of computers in large area.

6) Storage Domain: Refer to the storage, where we store the data.

7) Remote Access Domain: Refer to the domain where mobile user can access the local as well as wide network remotely.

8 0
3 years ago
What appears in the document after you have inserted a video?
Nitella [24]

Answer:

text with a hyperlink to the video website

Explanation:

documents do not auto-upload thumbnails or embedded videos for playback, so external links are pasted there

6 0
2 years ago
Read 2 more answers
You have just finished entering field names for your database . You need to choose the primary key or key field but none of your
Luden [163]

C. Let the database assign a unique number in a new field

3 0
3 years ago
Read 2 more answers
Other questions:
  • This technology was developed in the 1980s and was a successful attempt to provide services for voice, video, and video traffic
    11·1 answer
  • What’s a sign you should talk to an adult about your online time
    14·2 answers
  • A network address is 131.247.160.0/19. The 19 implies that
    5·1 answer
  • The hardware to keep the output data when finished is a
    9·1 answer
  • Which of the following is true regarding data acquisition? Because data acquisition is often technical, the research team does n
    15·2 answers
  • 27. If X and Y are int type variables,
    14·1 answer
  • Suppose Client A initiates a Telnet session with Server S. At about the same time, Client B also initiates a Telnet session with
    13·1 answer
  • Pro and Cons of Artificial Intelligence in Art <br><br> You must have 3 statements in each
    14·1 answer
  • What is Parallelism? And what is Pipelining?<br> Can someone please explain them fully?!
    14·1 answer
  • !!! PLEASE HELP ASAP REALLY NEED IT !!!
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!