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 multiple inheritance is not possible?
Why it is called runtime polymorphism?
What is the difference between a constructor and a destructor?
What is polymorphism what are the different types of polymorphism?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
Can enum be null?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
What does and I oop mean?
#include
What is purpose of inheritance?
What is variable example?
What is the advantage of oop over procedural language?
What is polymorphism what is it for and how is it used?
Whats is abstraction in oops?
What is for loop and its syntax?