#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
int choice, dmatrix, size;
int quit=0;
main()
{
matrix:
printf("Choose the type of MATRIX OPERATION/n");
printf("/n [1] Find the Determinant/n [2] Cofactor Matrix /n [3] Reduced Echelon Form /n [0]Exit Program");
scanf("%d", &choice);
switch(choice)
{
case 1:
printf("Enter the size of the matrix (max 5 by 5)");
scanf("%n", &dmatrix);
do
{
if (dmatrix == 1);
printf("INVALID MATRIX SIZE");
gotocase 1;
if (dmatrix ==2);
printf(" enter A11/n");
scanf("
getch();
break;
case 2:
printf("");
break;
case 3:
printf("Enter the size of the matrix (max 5 by 5)");
break;
case 0:
quit =50;
break;
default:
printf("Invalid choice Please Re-enter choice");
break;
goto matrix;
}
}
int main()
{
bool running(true);
while (running)
{
system("cls");
// put your printf scanf here
switch(choice)
{
case 1:
// to do
break;
case 2:
// to do
break;
case 3:
// to do
break;
case 0:
running = false;
break;
default:
// to do
};
}
return 0;
}
Using "goto" is almost always a terrible idea. ajh32's suggestion is vastly better. C and C++ have perfectly good control structures, including loops, and you should use them.