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
postnew [5]
3 years ago
5

Please develop a C program to reverse a series of integer number (read from the user until EOF issued by user) using stack ADT l

ibrary. Please include c code and three sample run demonstrations with at least 10 different numbers each time.
Computers and Technology
1 answer:
EleoNora [17]3 years ago
8 0

Answer:

#include <stdio.h>

#define MAX_CH 256

int main(void) {

int ch, i, length;

char string[MAX_CH];

for (;;) {

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

if ((ch = getchar()) == EOF || (ch == '\n')) break; string[i] = ch; }

length = i;

if (length == 0) { break; }

for (i = 0; i < length; i++) { putchar(string[length - i - 1]); }

putchar('\n');

}

return 0;

}

Explanation:

  • Take input from user until the end of file.
  • Reverse the string using the following technique:
  • putchar(string[length - i - 1])
You might be interested in
Design a program that will ask the user to enter the amount of a purchase. The program
LUCKY_DIMON [66]

The program is a sequential program, and they do not require loops and conditions

<h3>The program design in Python</h3>

The complete program written in Python is as follows:

purchaseAmount = float(input("Amount: "))

stateSalesTax = 0.05 * purchaseAmount

provincialSalesTax = 0.02 * purchaseAmount

print("Amount:",purchaseAmount)

print("State sales tax:",stateSalesTax)

print("Provincial sales tax:",provincialSalesTax)

print("Total sales tax:",(stateSalesTax + provincialSalesTax))

print("Total sales:",(purchaseAmount + stateSalesTax + provincialSalesTax))

Read more about Python programs at:

brainly.com/question/26497128

#SPJ1

4 0
2 years ago
6. What is the correct way to write 340,000,000 in scientific notation? (1 point
givi [52]

Answer:3.4X10^8

Explanation:

4 0
3 years ago
4.2 code need help plz someone 15 points if u help
Korolek [52]

def func():  

 total = 0

 while True:

   pet = input("What pet do you have? ")

   if pet == "rock":

     return

   total += 1

   print("You have a {} with a total of {} pet(s)".format(pet, total))

func()

We wrapped our code in a function so that whenever the user enters rock, we can simply return and exit the function. If you have any other questions, I'll do my best to answer them.

8 0
3 years ago
Every UNIX and Linux system contains full documentation of UNIX commands in the _____ pages.
Rashid [163]
Full documentation in the man pages.
8 0
4 years ago
The Internet is BEST described as a vast _______ connection of computer networks that also link to smaller networks. worldwide n
oksian1 [2.3K]

I think the answer is database


4 0
4 years ago
Other questions:
  • 25 points!!!!!!!!!!!!!!!!!!!!!
    9·2 answers
  • Which tag provides information about a web site?
    12·1 answer
  • An attacker compromises the Washington Post's web server and proceeds to modify the homepage slightly by inserting a 1x1 pixel i
    12·1 answer
  • I am on windows 10 OS. I have been trying to figure this out for ages! I want to get my task bar (on the bottom of the screen) t
    14·2 answers
  • You can use colors, patterns, and borders to enhance the overall appearance of a worksheet and to make it easier to read. One of
    11·1 answer
  • In which type of modulation is a 1 distinguished from a 0 by shifting the direction in whichthe wave begins?
    14·1 answer
  • true or false then EXPLAIN why. Since many forms of money do not earn interest, people's demand for money is unaffected by chang
    14·2 answers
  • What column, row, and text formatting issues are important when designing tables and lists?
    9·1 answer
  • Programs for embedded devices are often written in assembly language. Some embedded processors have limited instructions, like M
    5·1 answer
  • You want to search for contacts in your email program. You enter the person’s first name and last name in the search box. You wa
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!