How do I get my code to say compute root 7 of 52 to 5 digits or any decimal for those values for that matter?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

How do I get my code to say compute root 7 of 52 to 5 digits or any decimal for those values for that matter? 

9 File Edit View Navigate Code Refactor Build Run Iools VCS Window Help
program1 - main.cpp
program1
a main.cpp
O program1 | Debug
O Project v
A CMakelists.txt ×
C. main.cpp
| program1 C:\Users\abraw\CLionProjects\program1
#include <iostream>
A 3 A
>
cmake-build-debug
A CMakelists.txt
3 >
int main() {
E main.cpp
> uli External Libraries
4
int number;
int root;
PO Scratches and Consoles
6
int digit;
7
printf( format: "Number:");
scanf( format: "%d", &number);
10
11
printf( format: "Root:");
12
scanf( format: "%d", &root);
13
14
printf( format: "Digit:");
15
scanf( format: "%d", &digit);
16
17
printf( format: "Compute root (root) of (number) to (digit) digits");
18
f main
Run:
O program1 X
C:\Users\abraw\CLionProjects\program1\cmake-build-debug\program1.exe
Number: 52
Root:7
Digit:5
Compute root (root) of (number) to (digit) digits
Process finished with exit code 0
> Run
E TODO
9 Problems
> Terminal
Python Packages
CMake
E Messages
A Event Log
O Process finished with exit code 0
7:1 LF UTF-8 4 spaces C++: program1| Debug
3:35 PM
O Type here to search
a 4)
9/15/2021
(4
* Favorites
. Structure
0) Database
Transcribed Image Text:9 File Edit View Navigate Code Refactor Build Run Iools VCS Window Help program1 - main.cpp program1 a main.cpp O program1 | Debug O Project v A CMakelists.txt × C. main.cpp | program1 C:\Users\abraw\CLionProjects\program1 #include <iostream> A 3 A > cmake-build-debug A CMakelists.txt 3 > int main() { E main.cpp > uli External Libraries 4 int number; int root; PO Scratches and Consoles 6 int digit; 7 printf( format: "Number:"); scanf( format: "%d", &number); 10 11 printf( format: "Root:"); 12 scanf( format: "%d", &root); 13 14 printf( format: "Digit:"); 15 scanf( format: "%d", &digit); 16 17 printf( format: "Compute root (root) of (number) to (digit) digits"); 18 f main Run: O program1 X C:\Users\abraw\CLionProjects\program1\cmake-build-debug\program1.exe Number: 52 Root:7 Digit:5 Compute root (root) of (number) to (digit) digits Process finished with exit code 0 > Run E TODO 9 Problems > Terminal Python Packages CMake E Messages A Event Log O Process finished with exit code 0 7:1 LF UTF-8 4 spaces C++: program1| Debug 3:35 PM O Type here to search a 4) 9/15/2021 (4 * Favorites . Structure 0) Database
Expert Solution
Step 1

To print decimal places use '.*f' and pass the digits. 

Algorithm : 

Step 1 : declare variables.

Step 2 : ask for the number from user.

Step 3 : ask for the root from user.

Step 4 : ask for the digits from user.

Step 5 : find the root of the number.

Step 6 : print the value for those decimal places.

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education