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
which feature are not hold visual basic of oop?
Which type does string inherit from?
Why is abstraction used?
Give two or more real cenario of virtual function and vertual object
What is stream in oop?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
2. Give the different notations for the class.\
what is graphics
How do you explain polymorphism?
What is destructor give example?
Can main method override?
How oops is better than procedural?
What is methods in oop?
Which language is not a true object oriented programming language?
Can a varargs method be overloaded?