Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given a 0-terminated newline-delimited sequence of integers from standard input (i.e. cin), print the maximum value to standard output (i.e. cout). If the list is

Given a 0-terminated newline-delimited sequence of integers from standard input (i.e. cin), print the maximum value to standard output (i.e. cout). If the list is empty, print "empty".

I made the code and it works fine on an online compiler, but when I try to compile and run on Ubuntu I get errors. What do I have wrong?

image text in transcribed

Problem #include using namespace std; 4 int main(int arge, const char * argv[]) int nums, max, i; smillan DESKTOP 2EG CAP- dr Filesystem IK-blocks Used Available use% Mounted on rootfs 4/2585212 40113151221053640 859 none 4/2585212 401131532 71453680 85% /dev none 472585212 481131532 71453680 95% /run non 472585212 481131532 71453680 95% /run/lock non 472585212 481131512 71453680 95% /run/sh 477587317 48113151) 714536.90 95% /run/user 472587212 401131617 71453680 95% ml / D: 26214396 281290823401488 11% ml/d smillan DESKTOP 2 EGTAP:- cd fulf/lab2 smillan DESKTOP 2 EGTCAP:/mnt/c/CSCE121/lab2 15 FirstMimirsubmission.cpp Problemi Probleml.cppProblem2.cpp Problem2.0 smillan UESKTOP-2EGICAP:/mnt/c/CSCE121/1ab23 g++ -std-C++1/ - Problem2 Problem2.cpp /usr/11b/gcc/x86_64-1inux-gnu/1/../../../x86_64-linux-gnu/scrti.o: in function '_start": (.text+0x20): undefined reference to main collect2: error: ld returned I exit status smillandESKTOP-2CGTCAP:/mnt/c/CSCF121/1ab25 cout > nums; max - nums; while(nums 1- 0) { i++; if(num > max) max nums; cout > nums; //for no numbers entered if(i == ){ cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions