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
spayn [35]
4 years ago
10

Write a procedural programming loop.. Your loop should start variable n with a value of 10 and count down to zero. The loop shou

ld terminate when n reaches the value of zero.
Computers and Technology
1 answer:
anastassius [24]4 years ago
3 0

Answer:

//Here is the for loop in C.

for(n=10;n>0;n--)

{

   printf("count =%d \n",n);

}

Explanation:

Since C is a procedural programming language.Here if a loop that starts with n=10; It will run till n becomes 0. When n reaches to 0 then loop terminates otherwise it  print the count of n.

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{  // variables

int n;

// for loop that runs 10 times

// when n==0 then loop terminates

for(n=10;n>0;n--)

{

   cout<<"count ="<<n<<endl;

}

return 0;

}

Output:

count =10

count =9

count =8

count =7

count =6

count =5

count =4

count =3

count =2

count =1

You might be interested in
3.34 LAB: Mad Lib - loops in C++
Ganezh [65]

Answer:

A Program was written to carry out some set activities. below is the code program in C++ in the explanation section

Explanation:

Solution

CODE

#include <iostream>

using namespace std;

int main() {

string name; // variables

int number;

cin >> name >> number; // taking user input

while(number != 0)

{

// printing output

cout << "Eating " << number << " " << name << " a day keeps the doctor away." << endl;

// taking user input again

cin >> name >> number;

}

}

Note: Kindly find an attached copy of the compiled program output to this question.

7 0
3 years ago
Explain briefly why one should be very cautious when using a Wi-Fi hotspot.
soldi70 [24.7K]

Answer: Other people can access the same network and may have access to parts of your computer to try and steel your data.

Explanation:

6 0
3 years ago
Read 2 more answers
Write a method, makeSubjectLine, that gets a String argument and returns the same String but with "Subject: " in front of it. So
Anna [14]

Answer:

public class newass {

   /*

   Write a method, makeSubjectLine, that gets a String argument and returns the same String but with "Subject: " in front

   of it. So if the argument is "Are you going to the show?" the method returns "Subject: Are you going to the show?".

    */

   public static void main(String[] args) {

       System.out.println(makeSubjectLine("Are you going to the show?"));

   }

   public static String makeSubjectLine(String subj){

       return "Subject: "+subj;

   }

}

Explanation:

The solution in Java Programming Language

6 0
3 years ago
What are the disadvantages of using pointers?
garik1379 [7]

Explanation:

The pointer is the variable that will store the address of the other variable of the same datatype.

Following are the disadvantages of using a pointer.

1. Pointer sometimes causes a segmentation fault in the program.

2. Sometimes pointer leads to a memory leak.

3. A pointer variable is slower than normal variable.

4. Sometimes the program is crash if we using pointer because sufficient memory is not allocated during runtime.

5. If we using pointer it is difficult to find the error in the program.

5 0
3 years ago
Help me..and thank you​
kotykmax [81]

Answer:

#include <stdio.h>

void spaces(int n) {

 for(int i=0; i<n; i++) {

   putchar(' ');

 }

}

void numbersdown(int n) {

 for(int i=n; i>1; i--) {

   putchar('0'+i);

 }

}

void numbersup(int n) {

 for(int i=1; i<=n; i++) {

   putchar('0'+i);

 }

 putchar('\n');

}

int main(void) {

 int number;

 printf("Please enter a digit: ");

 scanf("%d", &number);

 for(int i=number; i>0; i--)

 {

   spaces(number-i);

   numbersdown(i);  

   numbersup(i);    

 }

}

Explanation:

I deliberately separated the solution into different functions for readability. If needed, the code could be made much more compact.

7 0
3 years ago
Other questions:
  • Sleeping is an effect of _______ , but agitation may cause a person to wake up
    7·2 answers
  • Which of the following could be omitted from a company's AUP? A.Permissible lunchtime online activities B.Employees' home email
    15·2 answers
  • What is the function of napier's bones<br>​
    8·1 answer
  • A communications medium that carries a large amount of data at a fast speed is called
    14·1 answer
  • Does Marietta college have open admission
    12·1 answer
  • You install a new driver, but your device still doesn't work. What is the first thing you should do?
    14·1 answer
  • One major challenge in developing an international information system is to find​ a(n) ________ when there is so much cultural a
    11·1 answer
  • Which term describes the gallery that allows you to customize and format text as a graphic? Pull Quote Text Box WordArt Drop Cap
    13·2 answers
  • Write the Java code to simulate an inventory control system and a point of sale system with customer history On program start, e
    5·1 answer
  • What are the services offered by web-based email?​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!