Public feed #527198

Something

public text v1 · immutable
Raw Edit
·published 2007-06-01 06:25 UTC
rendered paste body
#include <stdio.h>

main()

{
      char   artist[21];
      char   title[36];
      short  numtracks;
      char   type[2];
      char   type2[2];
      int    album;
      float  price;

      {
        printf("Enter the artist name: ");
          scanf("%[^\n]", artist);
        printf("\n");
      }
        fflush(stdin);
        {
          printf("Enter the title of the CD: ");
            scanf("%[^\n]", title);

        } printf("\n");
          {
            printf("Enter the number of tracks on the CD: ");
              scanf("%d", &numtracks);

          } printf("\n");

          fflush(stdin);

enteragain:

      {
        printf("Is the CD a single? Please press y/n: ");
          fflush(stdin);
           scanf("%c", &type);
           printf("\n");

        if (strcmp(type, "y") != 0)
          goto albumlabel;
        else
          goto skipnext;
      }
      fflush(stdin);

albumlabel:
        {
           printf("Is the CD an album? Please press y/n: ");
            fflush(stdin);
             scanf("%c", &type2);
             printf("\n");

          if (strcmp(type2, "y") != 0)
            goto enteragain;
        }

skipnext:

        printf("You are done\n");

        fflush(stdin);
      getchar();
}