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
Why is polymorphism used?
What is a class and object?
Which language is pure oop?
What is the problem with multiple inheritance?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
Where You Can Use Interface in your Project
Why do we use oop?
When not to use object oriented programming?
write a program that takes input in digits and display the result in words from 1 to 1000
How Do you Code Composition and Aggregation in C++ ?
How do you answer polymorphism?
What is polymorphism and types?
What is oops and why we use oops?
What are the data types in oop?
What is abstraction encapsulation?