Wednesday, March 18, 2020

  • Session

    Input & Ouput
  • Question ID

    1111110030 : IO 21
  • Problem Description

    Write a program to convert a floating point number into corresponding integer

    Input and Output Format:

    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output.
  • Logic Test Case 1

    Input (stdin)
    12.01
    
    
    Expected Output
    The integer variant of 12.01 is=12
  • Logic Test Case 2

    Input (stdin)
    23.15
    
    
    Expected Output
    The integer variant of 23.15 is=23



#include <stdio.h>
int main()
{

float a;
scanf("%f",&a);
printf("The integer variant of %0.2f is=%0.0f",a,a);
return 0;
}


No comments:

Post a Comment

cisco Cybersecurity Essentials Quiz 8 answer in bold

Question  1 Correct Mark 2.00 out of 2.00 Flag question Question text A company has had several incidents involving users downloading unauth...