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
What does and I oop mean?
What are the components of marker interface?
#include
How do you use inheritance in unity?
What is encapsulation in oops?
what are the ways in which a constructors can be called?
What is the highest level of cohesion?
What are the benefits of oop?
Why is polymorphism important in oop?
i got a backdoor offer in process global,Bangalore..Can i work with it?
Why it is called runtime polymorphism?
Is react oop?
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...
What is object in oop with example?
What are functions in oop?