Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to read the following numbers,round them off to the nearest integers and print out the results in integer form: 35.7 50.21 -23.73 -46.45

Posted By: Hilma Miller     Category: C Programming     Views: 2898

Write a program to read the following numbers,round them off to the nearest integers and print out the results in integer form:

35.7 50.21 -23.73 -46.45

Code for Program to read the following numbers,round them off to the nearest integers and print out the results in integer form: 35.7 50.21 -23.73 -46.45 in C Programming

#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{
    float n;
    clrscr();

    printf("Enter the number:-");
    scanf("%f",&n);

    printf("The integer number after rounded is  %5.0f",n);
    getch();
}


/*
********
OUTPUT
********

Enter the number:-12

The integer number after rounded is 12
*/
  
Share: 



Hilma Miller
Hilma Miller author of Program to read the following numbers,round them off to the nearest integers and print out the results in integer form: 35.7 50.21 -23.73 -46.45 is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!