I am pasting my code below, plz i want to have the answer of my
Input in the same line where i write question...
Example: if i write 2*5 so by entering it should
Give answer in the same first line like this
2*5=10
Have a look... i am getting answer in next line.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
char op;
cout<<"Enter Question: ";
cin>>a>>op>>b;
if(op=='+')
{
cout<<"Your Answer is: "<<a+b;
}
else if(op=='-')
{
cout<<"Answer is: "<<a-b;
}
else if(op=='*')
{
cout<<"Answer is: "<<a*b;
}
else if(op=='/')
{
cout<<"Answer is: "<<a/b;
}
else
{
cout<<"Wrong Operator!";
}
getch();
}
New to programming, just a month old, but why not try adding the new line after you entered the operations or even endl; to each of them