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 the difference between procedural programming and oops?
Why multiple inheritance is not possible?
Why do while loop is used?
What is polymorphism what are the different types of polymorphism?
Why interface is used?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
How to improve object oriented design skills?
Can we override main method?
• What are the desirable attributes for memory managment?
Can we create object of abstract class?
Write a program to reverse a string using recursive function?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
what are the different types of qualifier in java?
What is encapsulation in oops?
What is multilevel inheritance in oop?