Round up a Decimal number in c++..

example Note = 3.5 is as 4
3.3 is as 3

Answer Posted / vimala

void main()
{
float a,c;int b,d;
cout<<"ENTER ANY FLOAT VALUE:";
cin>>a;
b=a;c=(a-b);
if(c>=.5)
d=b+1;
else
d=b;
cout<<"AFTER ROUND UP THE DECIMAL NO IS:"<<d;
getch()
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 3 pillars of oop?

607


what is graphics

2003


What is object and example?

596


What makes a language oop?

590


Why do we use polymorphism?

570






How to improve object oriented design skills?

565


What is pure oop?

587


What is encapsulation c#?

597


What are functions in oop?

580


Why do we use polymorphism in oops?

573


what is difference between class template and template class?

2152


program for insertion ,deletion,sorting in double link list

2274


What is this pointer in oop?

548


What is encapsulation in oops?

531


What is abstract class in oops?

593