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
What are the 3 pillars of oop?
what is graphics
What is object and example?
What makes a language oop?
Why do we use polymorphism?
How to improve object oriented design skills?
What is pure oop?
What is encapsulation c#?
What are functions in oop?
Why do we use polymorphism in oops?
what is difference between class template and template class?
program for insertion ,deletion,sorting in double link list
What is this pointer in oop?
What is encapsulation in oops?
What is abstract class in oops?