Round up a Decimal number in c++..
example Note = 3.5 is as 4
3.3 is as 3
Answer Posted / vivek
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
float a,b,c;
int k;
cout << "enter 1st number ";
cin>>a;
cout<<"enter 2nd number ";
cin>>b;
c=a/b;
cout<<"original value "<<c;
if (c=c+0.5)
{
k=c;
cout<<"\n"<<"round figure "<<k;
}
else
return 0;
}
Hope this code helped u smways
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
#include
What is the purpose of polymorphism?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
Which language is not a true object oriented programming language?
What is abstraction and encapsulation?
what is different between oops and c++
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is a class in oop?
What is encapsulation in oop?
Can abstract class have normal methods?
What does and I oop mean?
Can we create object of abstract class?
Prepare me a program for the animation of train
Why oops is important?
How do you answer polymorphism?