Write C statements that perform the following operations: a) Display the statements" Congratulations! you have passed the exam b) Print 748.223 left-justified in a 9 digit field and 2 digits of precision. on the screen. c) Read 3 values (type decimal integer, float, character) into variable A, B and C in one statement. d) Read a string into character array string e) Declare the variable num1 to be of type float and num2 to be of type integer. Then, assign 18 to variable num1 and 25 to variable num2.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 7PP: (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point...
icon
Related questions
Question

do it

Write C statements that perform the following operations:
a) Display the statements" Congratulations! you have passed the exam" on the screen.
b) Print 748.223 left-justified in a 9 digit field and 2 digits of precision.
c) Read 3 values (type decimal integer, float, character) into variable A, B and C in one
statement.
d) Read a string into character array string
e) Declare the variable num1 to be of type float and num2 to be of type integer. Then, assign 18
to variable num1 and 25 to variable num2.
Transcribed Image Text:Write C statements that perform the following operations: a) Display the statements" Congratulations! you have passed the exam" on the screen. b) Print 748.223 left-justified in a 9 digit field and 2 digits of precision. c) Read 3 values (type decimal integer, float, character) into variable A, B and C in one statement. d) Read a string into character array string e) Declare the variable num1 to be of type float and num2 to be of type integer. Then, assign 18 to variable num1 and 25 to variable num2.
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Array
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr