basically my code stops working after my first input where i chose one of the following cases, but it should keep on workin until i choose case x.
can anybody help and tell me where the issue is?

```
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>

int main(){
char choice;
int a,b,c,s;
int F;

    printf("Objekttyp wahlen:\n (R) Rechteck\n (E) Ellipse\n (D) Dreieck\n (x) Exit\n");
        choice = getchar();
            while(choice == '\n'){
                choice = getchar();
            }

            switch(choice){
            case 'R':
                printf("Seitenlaengen a,b des Rechtecks: ");
                    scanf("%d%d" &&a, &b);
                        F = a * b;
                            printf("F = %d", F);
                break;

            case 'E':
                printf("Halbachsen der Ellipse: ");
                    scanf("%d%d" &&a, &b);
                        F = 3.14 * a * b;
                            printf("F = %d", F);
                break;
            case 'D':
                printf("Seitenlaengen a,b,c des Dreiecks: ");
                    scanf("%d%d%d" &&a,b,c);

                            printf("F = %d", F);
                break;
            case 'x':
                exit(0);
                break;

            default :
                printf("Ungueltige Eingabe!\n\n");
            }while(choice != 'x');

}

```
['https://Stackoverflow.com/questions/67850085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16137524/']
use a do-while loop, instead of switch-while because the switch while loop doesn't exist, at least not in c++ or c.

```
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>

int main(){
char choice;
int a,b,c,s;
int F;
do{
    printf("Objekttyp wahlen:\n (R) Rechteck\n (E) Ellipse\n (D) Dreieck\n (x) Exit\n");
        choice = getchar();
            while(choice == '\n'){
                choice = getchar();
            }

            switch(choice){
            case 'R':
                printf("Seitenlaengen a,b des Rechtecks: ");
                    scanf("%d%d" &&a, &b);
                        F = a * b;
                            printf("F = %d", F);
                break;

            case 'E':
                printf("Halbachsen der Ellipse: ");
                    scanf("%d%d" &&a, &b);
                        F = 3.14 * a * b;
                            printf("F = %d", F);
                break;
            case 'D':
                printf("Seitenlaengen a,b,c des Dreiecks: ");
                    scanf("%d%d%d" &&a,b,c);

                            printf("F = %d", F);
                break;
            case 'x':
                exit(0);
                break;

            default :
                printf("Ungueltige Eingabe!\n\n");
            }
    }while(choice != 'x');

}

```
By the way: If you want to output the German umlauts in the console (for example `"Ungültige Eingabe!\n\n"`), you can write: `printf("Ung\x81 \bltige Eingabe!\n\n");`
The console is using the [codepage 850](https://de.wikipedia.org/wiki/Codepage_850)...

`printf("Seitenl\x84 \bngen a,b des Rechtecks: ");`

You just have to put a space after \x81 so that the next character is not interpreted with the previos characters. You can undo this extra space with \b.