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
kari74 [83]
4 years ago
13

Write a C11 program that prompts the user to input the elapsed time for an event in seconds. The program then outputs the elapse

d time in hours, minutes, and seconds. (For example, if the elapsed time is 9,630 seconds, then the output is 2:40:30.)
Computers and Technology
1 answer:
torisob [31]4 years ago
7 0

Answer:

Explanation:

#include <iostream>

using namespace std;

int main()

{

int secondsElapsed, hours, minutes, seconds;

const int secondsPerMinute = 60;

const int secondsPerHour = 60 * secondsPerMinute;

cout << "Please enter the number of seconds elapsed: ";

cin >> secondsElapsed;

hours = secondsElapsed / secondsPerHour;

secondsElapsed = secondsElapsed % secondsPerHour;

minutes = secondsElapsed / secondsPerMinute;

seconds = secondsElapsed % secondsPerMinute;

cout << hours << ":" << minutes << ":" << seconds << endl;

return 0;

}

You might be interested in
A network needs to be set up with 60 subnets. Given the IPv4 class C address 192.168.100.0, what subnet mask value should be use
d1i1m1o1n [39]
We are asked for the subnet mask and the total usable host. There are given values such as a network needs to be set up with 60 subnets given that the IPv4 class C address 192.168.100.0. The subnet mask is "255.255.255.0". The total host is "254".
6 0
4 years ago
In c please
Paraphin [41]

Answer:

#include <stdio.h>

#include <ctype.h>

void printHistogram(int counters[]) {

   int largest = 0;

   int row,i;

   for (i = 0; i < 26; i++) {

       if (counters[i] > largest) {

           largest = counters[i];

       }

   }

   for (row = largest; row > 0; row--) {

       for (i = 0; i < 26; i++) {

           if (counters[i] >= row) {

               putchar(254);

           }

           else {

               putchar(32);

           }

           putchar(32);

       }

       putchar('\n');

   }

   for (i = 0; i < 26; i++) {

       putchar('a' + i);

       putchar(32);

   }

}

int main() {

   int counters[26] = { 0 };

   int i;

   char c;

   FILE* f;

   fopen_s(&f, "story.txt", "r");

   while (!feof(f)) {

       c = tolower(fgetc(f));

       if (c >= 'a' && c <= 'z') {

           counters[c-'a']++;

       }

   }

   for (i = 0; i < 26; i++) {

       printf("%c was used %d times.\n", 'a'+i, counters[i]);

   }

   printf("\nHere is a histogram:\n");

   printHistogram(counters);

}

5 0
3 years ago
Explain the following as used in Tally Accounting Software:
vaieri [72.5K]
Business transactions
3 0
3 years ago
Within the manufacturing industry, there are fourteen subindustries. Which of the
inna [77]

Answer: A or B i done this before but my memorys quite blurry i rekon doing A

Explanation:

3 0
2 years ago
_____ is(are) often used in reports to quickly represent data and help the readers understand the data.
Ira Lisetskai [31]
Tables are used<span> to </span>present <span>numerical </span>data<span> in a wide variety of publications from newspapers, journals and textbooks to the sides of grocery packets.</span>
6 0
4 years ago
Other questions:
  • Which of the following is NOT one of the most important elements when designing a website?
    8·2 answers
  • 1. Why is it important to compare features of a computer before making a purchase?
    13·2 answers
  • Effective presentations vary the color scheme on each slide.
    7·2 answers
  • A network with 6 bits remaining for the host portion will have how many usable hosts?​
    9·1 answer
  • Randy earn $22 per hour. This is an example of
    11·1 answer
  • If you notice files being transferred to or from your computer a. Simply close the window c. Tell the lab instructor b. Open a n
    11·2 answers
  • 5.8.1: Modify an array parameter. Write a function SwapArrayEnds() that swaps the first and last elements of the function's arra
    14·1 answer
  • Using a conversation voice is part of:
    9·1 answer
  • Unscramble thr words <br>1.Nsieg Wiev<br>2.Seeathdat ievw​
    13·2 answers
  • 8.5 Edhesive Code Practice
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!