Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
bartleby
Concept explainers
Question
Hello can you please solve all of the problems on these images using the C progaming language. I want to check my answers to see if I did my work correctly.
Transcribed Image Text:54
Chapter 2 Introducing C
5. Write a program that produces the following output:
Brazil, Russia, India, China
India, China,
Brazil, Russia
Have the program use two user-defined functions in addition to main(): one named
br() that prints "Brazil, Russia" once, and one named ic() that prints "India, China"
once. Let main() take care of
any additional printing tasks.
6. Write a program that creates an integer variable called toes. Have the program set toes
to 10. Also have the program calculate what twice toes is and what toes squared is. The
program should print all three values, identifying them.
7. Many studies suggest that smiling has benefits. Write a program that produces the
following output:
Smile! Smile! Smile!
Smile! Smile!
Smile!
Have the program define a function that displays the string Smile! once, and have the
program use the function as often as needed.
8. In C. one function can call another. Write a program that calls a function named one
three(). This function should display the word one on one line, call a second function
named two ( ), and then display the word three on one line. The function two() should
display the word two on one line. The main () function should display the phrase
starting now: before calling one_three() and display done! after calling it. Thus the
output should look like the following:
starting now:
one
three
done!
Transcribed Image Text:printf("%d %d\n", x, y);
return 0;
{
What is the program state after line 7? Line 8? Line 9?
Programming Exercises
Reading about C isn't enough. You should try writing one or two simple programs to see
whether writing a program goes as smoothly as it looks in this chapter. A few suggestions
follow, but you should also try to think up some problems yourself. You'll find answers to
selected programming exercises on the publisher's website.
1. Write a program that uses one printf() call to print your first name and last name on
one line, uses a second printf() call to print your first and last names on two separate
lines, and uses a pair of printf() calls to print your first and last names on one line.
The output should look like this (but using your name):
Gustav Mahler First print statement
ESecond print statement
Gustav
Mahler
EStill the second print statement
Gustav Mahler Third and fourth print statements
2. Write a program to print your name and address.
3. Write a program that converts your age in years to days and displays both values. At this
point, don't worry about fractional years and leap years.
4. Write a program that produces the following output:
For he's a jolly good fellow!
For he's a jolly good fellow!
For he's a jolly good fellow!
Which nobody can deny!
Have the program use two user-defined functions in addition to main(): one named
jolly() that prints the "jolly good" message once, and one named deny() that prints
the final line once.
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
This is a popular solution
bartleby
Trending nowThis is a popular solution!
bartleby
Step by stepSolved in 3 steps with 1 images
Knowledge Booster
Background pattern image
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
- In the context of computer graphics, please define "local" and "global" lighting and provide examples of both.arrow_forwardSo, are these statements correct? It is impossible to display on a single map several layers (data) using different coordinate systems. For GIS purposes, it is allowed for data to include several coordinate systems. A map may display several different layers of data, each with its own set of coordinates. A map's layers may not align correctly if you use several coordinate systems to display them. Those things are not includedarrow_forwardWhat role does the reflection vector play in computer graphics? You must include at least two instances to back up your claim.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education