LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 04-04-2022, 02:22 PM   #1
byKyubii
LQ Newbie
 
Registered: Apr 2022
Posts: 4

Rep: Reputation: 0
Post Return of "Hello, world" when the program is called (no matter if input parameters exist)


Hello Linux friends,

I am currently trying to learn Linux and am faced with the following task.

I want to write a "Hello-World" C program with the following functionality:

When called, the function should return the following (with or without input parameters):
"Hello, World!"

The finished program should then be called with the following command.
$ make && ./hello

The following commands must be callable via "make":
- make
- make clean

So the evaluation needs the following files:
- Makefile
- hello.c

All libc functions can also be used for programming.

Below you can find example calls:
===============

1. example
-----------
$ make && ./hallo
cc -c -o hallo.o hallo.c
cc hallo.o -o hallo
Hallo, Welt!


2. example
-----------
$ make && make clean && ./hallo
cc -c -o hallo.o hallo.c
cc hallo.o -o hallo
rm -f hallo.o
Hallo, Welt!


Thank u for your help!
 
Old 04-04-2022, 02:43 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by byKyubii View Post
Hello Linux friends,
I am currently trying to learn Linux and am faced with the following task. I want to write a "Hello-World" C program with the following functionality:

When called, the function should return the following (with or without input parameters):
"Hello, World!"

The finished program should then be called with the following command.
$ make && ./hello

The following commands must be callable via "make":
- make
- make clean

So the evaluation needs the following files:
- Makefile
- hello.c

All libc functions can also be used for programming.

Below you can find example calls:
===============

1. example
-----------
$ make && ./hallo
cc -c -o hallo.o hallo.c
cc hallo.o -o hallo
Hallo, Welt!


2. example
-----------
$ make && make clean && ./hallo
cc -c -o hallo.o hallo.c
cc hallo.o -o hallo
rm -f hallo.o
Hallo, Welt!

Thank u for your help!
This is your THIRD POST where you have done nothing but ask people to do your homework for you. Read the previous two, along with the LQ Rules.
 
Old 04-04-2022, 06:10 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

Additionally, please wrap your code and data snippets inside [CODE]...[/CODE] tags. Doing so will preserve indentation and provide other visual clues which make it easier for others to comprehend. You may write those yourself as shown, or use the # button available with Advanced edit options. (A complete list of BBCode tags is always available via a link near the bottom of every thread view).

Last edited by astrogeek; 04-04-2022 at 06:13 PM.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kprobe return callback not called on function return bogdanul2003 Linux - Kernel 1 03-16-2017 11:17 AM
[SOLVED] Destructor called on objects in deque without it being called explicitly Snark1994 Programming 4 07-13-2011 08:05 AM
[SOLVED] Awk: Input from one line, execute program; input from next line, execute program C.L. Programming 9 09-27-2010 12:06 AM
Trouble getting input from USB keyboard in a C++ program called from a SSH shell kungpower13 Programming 1 11-03-2009 07:28 PM
Repeated "input: AT Translated Set 2 keyboard as /class/input/input" messages AcerKev Mandriva 2 09-16-2007 08:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration