No.Both abort() and exit() terminate the program and not the function only. Abort() ends the program with "abnormal program termination".It indicates unsuccessful termination of program.
No.Both abort() and exit() terminate the program and not the function only. Abort() ends the program with "abnormal program termination".It indicates unsuccessful termination of program.
hello chirag mittal,
Here is an example of do while loop in your program.
void main()
{ .
.
.
setprecision(2);
do
{ clrscr();
.
.
.
switch(ch)
{
case 1: ...
case 2: ....
.
.
.
default:
...//remove the goto in default
}
}while(yn!='y');
}
the above do while loop displays the first menu(bill reports,show edit item,add/remove etc.,) till you exit.
Likewise replace all goto's with do while
your program works finely.But it throws floating point error if the value of b*b is less than 4.0*a*c,because sqrt are not meant for negative numbers.
Also use getch() at the end of the program before return(0),so that the output is displayed till you press a key.
getch() prototype-conio.h
You can use do while loop for the whole block and give the condition in the do while loop as...
}while(yn!='y');