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 is inheritance in oop?
What is pointer in oop?
What is polymorphism and example?
What is polymorphism in oops?
How oops is better than procedural?
How do you use inheritance in unity?
What is inheritance in simple words?
What is oops with example?
Can bst contain duplicates?
What is overloading in oops?
What is object in oops?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
What does and I oop mean?
Why do we use class in oops?
What is oops and why we use oops?