Advertisement
yanni_yagami

Untitled

Oct 31st, 2020
2,115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void)
  5. {
  6.     char question[50], reponses[3][50];
  7.     int type, notes[3];
  8.  
  9.     printf("veillez entrer votre question : ");
  10.     fgets(question, 50, stdin);
  11.  
  12.     printf("veillez selectionner son type : \n");
  13.     printf("1. vrai ou faux.\n");
  14.     printf("2. choix unique.\n");
  15.     printf("3. choix multiple.\n");
  16.  
  17.     printf("veillez choisir : ");
  18.     scanf("%d", &type);
  19.     getchar();
  20.  
  21.     if(type == 1)
  22.     {
  23.         strcpy(reponses[0], "vrai");
  24.         strcpy(reponses[1], "faux");
  25.     }
  26.  
  27.     else
  28.     {
  29.         for(int i = 0; i < 3; i++)
  30.         {
  31.             printf("veillez entrer une reponse : ");
  32.             fgets(reponses[i], 50, stdin);
  33.             printf("veillez entrer sa note : ");
  34.             scanf("%d", &notes[i]);
  35.             getchar();
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement