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
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
class type to basic type conversion
Can abstract class have normal methods?
• What are the desirable attributes for memory managment?
What is oops in programming?
hi all..i want to know oops concepts clearly can any1 explain??
What is overloading in oops?
What is object and class in oops?
Who invented oop?
What is difference between class and object with example?
What is new keyword in oops?
What is encapsulation with example?
is there any choice in opting subjects like 4 out of 7
What are the 3 pillars of oop?