0
int i=0,j=0;
	char operand[30];
	char lbl[20],opr,num[20];
	while(i<30)
		lbl[i]=num[i]=operand[i++]=NULL;
	
	cin>>operand;

	for(i=0; operand[i]!='+' || operand[i]!='-'; i++)
		lbl[i]=operand[i];
	opr=operand[i++];
	while(operand[i]!=NULL)
		num[j++]=operand[i++];

..is there any mistake in this piece of code, my execution is getting stuck at

lbl[i]=operand[i];
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Ancient Dragon
0

>>operand!='+' || operand!='-';

Use && operator instead of ||. Read the statement aloud to yourself -- "do while operand not + and while operand not -.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.