So here my problem is i cannt figure out how to save the input that the user inserted before and it will be displayed when user dont want to continue the process.. below is my code.. when user select the choice for example 1.. and user will input the straight line.. and after that user willing to input another selection .. let say 2 and user input the rectangle.. once done user dont want to continue the process and wanted to end the program and it will showing the summary of the input and result that user had entered before... sound pretty easy.. but i didnt know where i want start

Code:
#include<stdio.h>
#include<cstdlib>
int main()
{
    int num,height;
    char selection;

        
        printf("\n\t\t___________________________________________");
        printf("\n\t\t-Please chose your selection between 1 to 4 -");
        printf("\n\t\t___________________________________________");
        printf("\n\t\t|    1 : Straight Line          |");
        printf("\n\t\t|    2 : Rectangle              |");
        printf("\n\t\t|    3 : Triangle              |");
        printf("\n\t\t|    4 : Diamond              |");
        printf("\n\t\t___________________________________________\n");
        
        printf("\n\t\tYour selection : ");
        scanf("%c", &selection);
    
        switch (selection){
        case '1':
            {
                printf("\n\nEnter the length of * : ");
                scanf("%d", &num);
                for(int row=1; row<=num;row++)
            {
                printf("* ");
            }
                printf("\n\n");
                printf("Number of * is : %d \n\n",num);
                break;
            }

        case '2' :
            {
            int length, width;
            double area;
                printf("Please enter the length of Rectangle :");
                scanf("%d", &length);
                printf("\nPlease enter the width of Rectangle :");
                scanf("%d", &width);

                int column = 0;
                while(column < length)
            {
                column++;
                    int row = 0;
                    while(row <= width)
                {      
 
                    if (((row > 1)&&(row < width))&&((column > 1)&&(column < length)))
                {
                        printf("  ");
                    }
                        else if((row !=0 )&&(column!=0))
                    {
                        printf("* ");
                    }
 
                        row++;
                    }
                        printf("\n");         
 
                    }
                        printf("\n");
                        area = length * width;
                        printf("%d * %d = %.2f\n\n",length,width,area);
                        printf("Area of rectangle is: %.2f\n\n",area);
                        break;
                    }

        case '3':
            {
                int num,h,i,j;
                double AreaOfTriangle;
                    printf("\nPlease enter the height of triangle: ");
                    scanf("%d", &num);
                    printf("*\n");
                for(h=1; h<=num-2;h++)
            {
                    printf("* ");
                for(j=1; j<h; j++)
                    printf("  ");
                    printf("* \n");
            }
                for(i=1; i<=num; i++)
                    printf("* ");
                    printf("\n\n");
                AreaOfTriangle = (num*num)/2;
                printf("(%d*%d)/2 = %.2f\n\n",num,num,AreaOfTriangle);
                printf("The area of triangle is %.2f: \n\n",AreaOfTriangle);
                break;
            }
        case '4':
            {
            double area;
            printf("\nEnter the height of Diamond :");
            scanf("%d", &height);
            for(int i=-height;i<=height;i++)
                {
                for(int j=-height; j<=height; j++)

            {

            if( abs(i)+abs(j)==height - 1)

                { 
                    printf("*");
            }

            else 
            { 
            printf(" ");
            }
            }

            printf("\n");
            }
            area = 2*(height*height);
            printf("Area of diamond is: %.3f\n",area);
            break;
            }
        default:
            {
            printf("\nOut Of Selection!!\n");
            return 0;
            }
    
                
    }    
    
}