Round up a Decimal number in c++..
example Note = 3.5 is as 4
3.3 is as 3
Answer Posted / vimala
void main()
{
float a,c;int b,d;
cout<<"ENTER ANY FLOAT VALUE:";
cin>>a;
b=a;c=(a-b);
if(c>=.5)
d=b+1;
else
d=b;
cout<<"AFTER ROUND UP THE DECIMAL NO IS:"<<d;
getch()
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is this pointer in oop?
What does sksksk mean in text slang?
What is polymorphism give a real life example?
What is the real life example of polymorphism?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What is overriding vs overloading? Why do we use class in oops? what is different between oops and c++ write a programe to calculate the simple intrest and compund
intrest using by function overlading any one please tell me the purpose of operator overloading
What is class and object in oops? • What are the desirable attributes for memory
managment? Is data hiding and abstraction same? What is the difference between static polymorphism and dynamic polymorphism? What is a class oop?