C Programming Language
C Programming Language
2nd Edition
ISBN: 9780131103627
Author: Brian W. Kernighan, Dennis M. Ritchie, Dennis Ritchie
Publisher: Prentice Hall
bartleby

Videos

Textbook Question
Book Icon
Chapter 1, Problem 1E

Run the “hello, world” program on your system. Experiment with leaving out parts of the program, to see what error messages you get.

Expert Solution & Answer
Check Mark
Program Plan Intro

To run the hello world program and experiment with leaving out parts of the hello world program, to see the error message.

Explanation of Solution

Program:

//Leaving out header file
//#include <stdio.h>
main()
{
printf("Hello, ");
	printf("World");
printf("\n");
}

Explanation:

The program above leaving the header file <stdio.h> statement to see the error. There is a warning in the program and shows the output.

Sample Output:

C Programming Language, Chapter 1, Problem 1E , additional homework tip  1

Program: 

#include <stdio.h>
//Leaving out main function
//main()
{
printf("Hello, ");
	printf("World");
printf("\n");
}

Explanation:

The program above leaving the main function to see the error. There is an error in program line 4.

Sample Output:

C Programming Language, Chapter 1, Problem 1E , additional homework tip  2

Program: 

#include <stdio.h>
main()
{
//Leaving out first statement line
//printf("Hello, ");
	printf("World");
printf("\n");
}

Explanation:

The program above leaving the first statement line to see the error. There is no error and print world, then a new line.

Sample Output:

C Programming Language, Chapter 1, Problem 1E , additional homework tip  3

Program: 

#include <stdio.h>
main()
{
printf("Hello, ");
//Leaving out second statement line
	//printf("World");
printf("\n");
}

Explanation:

The program above leaving the second statement line to see the error. There is no error and print hello, then a new line.

Sample Output:

C Programming Language, Chapter 1, Problem 1E , additional homework tip  4

Program: 

#include <stdio.h>
main()
{
printf("Hello, ");
	printf("World");
	//Leaving out third statement line
//printf("\n");
}

Explanation:

The program above leaving the third statement line to see the error. There is no error and print hello,world without a new line.

Sample Output:

C Programming Language, Chapter 1, Problem 1E , additional homework tip  5

Program: 

#include <stdio.h>
//Leaving out curley braces.

main()
//{
printf("Hello, ");
printf("World");
printf("\n");
//}

Explanation:

On leaving the curly braces the program will not compile and produce compilation error.

Sample Output:

C Programming Language, Chapter 1, Problem 1E , additional homework tip  6

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
1. Complete the routing table for R2 as per the table shown below when implementing RIP routing Protocol? (14 marks) 195.2.4.0 130.10.0.0 195.2.4.1 m1 130.10.0.2 mo R2 R3 130.10.0.1 195.2.5.1 195.2.5.0 195.2.5.2 195.2.6.1 195.2.6.0 m2 130.11.0.0 130.11.0.2 205.5.5.0 205.5.5.1 R4 130.11.0.1 205.5.6.1 205.5.6.0
Analyze the charts and introduce each charts by describing each. Identify the patterns in the given data. And determine how are the data points are related.   Refer to the raw data (table):
3A) Generate a hash table for the following values: 11, 9, 6, 28, 19, 46, 34, 14. Assume the table size is 9 and the primary hash function is h(k) = k % 9. i) Hash table using quadratic probing ii) Hash table with a secondary hash function of h2(k) = 7- (k%7) 3B) Demonstrate with a suitable example, any three possible ways to remove the keys and yet maintaining the properties of a B-Tree. 3C) Differentiate between Greedy and Dynamic Programming.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
A+ Guide to Hardware (Standalone Book) (MindTap C...
Computer Science
ISBN:9781305266452
Author:Jean Andrews
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
The Top Down Approach to Software Development; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=v9M8LA2uM48;License: Standard YouTube License, CC-BY