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 the advantage of oop over procedural language?
What is object in oop?
What is overloading in oops?
What is byval and byref? What are differences between them?
Can private class be inherited?
Which type does string inherit from?
What is object-oriented programming? Webopedia definition
why reinterpret cast is considered dangerous?
How does polymorphism work?
What does and I oop mean in text?
What is object in oop with example?
program for insertion ,deletion,sorting in double link list
What is polymorphism and types?
What is polymorphism explain?
write a program to find 2^n+1 ?