Write a program to read following numbers from your keyboards in C, round them to their nearest integer and print the result in integer format. 37.7 50.123 -25.5649 -56.8877 123.0



#include<stdio.h>
#include<conio.h>
void main()
{
  float n;
  printf("Enter the float number = ");
  scanf("%f",&n);
  int a=(int)n;
  printf("Integer Number is = %d",a);
getch();
}

OUTPUT:-
 
Previous Post
Next Post