Answer:
// here is code in java.
import java.util.*;
// class definition
class Main
{
// method that return the digits of number
public static void dig(int num)
{
// while loop
while(num>0)
{
// print the digits
System.out.println(num%10);
num=num/10;
}
}
//driver method
public static void main (String[] args) throws java.lang.Exception
{
try{
// scanner object to read input string
Scanner s=new Scanner(System.in);
// variable
int num;
System.out.print("please enter the number: ");
//read the number
num=s.nextInt();
// validate the input, read a positive number only
while(num<=0)
{
System.out.print("enter a positive number only:");
num=s.nextInt();
}
System.out.println("digit of number are:");
// call the function
dig(num);
}catch(Exception ex){
return;}
}
}
Explanation:
Read a number from user and assign it to variable "num".Check if it is positive or not.If input is negative then ask user to again enter a positive number till user enter a positive number.Then call the function with input number. In this method it will find the digits of the number in the while loop using modulus "%" operator.
Output:
please enter the number: -345
enter a positive number only:1234
digit of number are:
4
3
2
1
Answer:
- def c_to_f(celsius):
- return celsius * 9/5 + 32
-
- temp_c = float(input('Enter temperature in Celsius: '))
- temp_f = None
-
- temp_f = c_to_f(temp_c)
- print('Fahrenheit:' , temp_f)
Explanation:
The first piece of code we can fill in is the formula to convert Celsius to Fahrenheit and return it as function output (Line 2).
The second fill-up code is to call the function c_to_f and pass temp_c as argument (Line 7). The temp_c will be processed in the function and an equivalent Fahrenheit value will be returned from the function and assigned it to temp_f.
Answer:
Table
Explanation:
A table allows data to be arranged properly and more efficiently using a two dimensional format based on rows and columns. Once data are arranges in tables, various operations can be done or carried out on the table values including comparison operation. As location of data values can be accessed more precisely using this table function. To access a table in a word processing program, kindly locate the insert option tab and click on the insert table option to create a table where you can also specify the number of row, and columns including other table customization.
Answer:
Can you please explain your question it does not really make sense
Explanation:
Answer:There are 7 printers.