Skip to main content

Get the input(N) as float number from the user and display the numbers in one, two and three digit floating numbers as displayed in sample output. Input format A float number (N). Output format One digit floating number Two digit floating number Three digit floating number. Sample testcases Input 1 12.2345

 Get the input(N) as float number from the user and display the numbers in one, two and three digit floating numbers as displayed in sample output.

Input format

A float number (N).

Output format

One digit floating number

Two digit floating number

Three digit floating number.

Sample testcases
Input 1
12.2345

OUTPUT

#include<stdio.h>
#include<stdlib.h>
int main()
{
    double number;
    scanf("%lf",&number);
    printf("%.1f\n%.2f\n%.3f\n",number,number,number);
    return 0;
}

Comments

Popular posts from this blog

Raju is a Civil Engineer. He is writing software to automate his work. As a part of his requirement, he wants to calculate the circle diameter, circumference, and area. Help Raju to complete his task. Get radius as input.

OUTPUT

Select the option that is most nearly OPPOSITE in meaning to the word or phrase is given in bold. Birds are quarantined to prevent the spread of bird flu.

Select the option that is most nearly OPPOSITE in meaning to the word or phrase is given in bold. Birds are  quarantined  to prevent the spread of bird flu. immunized butchered secluded CORRECT mingled