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 is destructor in oop?
can we make game by using c
What is the fundamental idea of oop?
what is graphics
Why is polymorphism used?
Can a varargs method be overloaded?
What is the importance of oop?
What is advantage of inheritance?
how to get the oracle certification? send me the answer
What does sksksk mean in text slang?
What is polymorphism what is it for and how is it used?
What is polymorphism and why is it important?
What is abstraction encapsulation?
How oops is better than procedural?
What is constructor in oop?