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

Seetha, a maths teacher has started to learn the C programming language. She writes a program to do basic arithmetic operations. Help Seetha to complete her first program.

OUTPUT