0

I am writing a very simple code where the input will be like:

  1. First line will have number of strings user will enter. Eg:2
  2. Print the string

    char str[20];   
    int TC=0;
    scanf("%d",&TC); //get number of strings
    while(TC!=0){ //read all the strings and print
        fgets(str,19,stdin);
        printf("%s\n",str);
        TC--;
    }
    

The code takes N-1 input strings from user rather than N.

melpomene
  • 84,125
  • 8
  • 85
  • 148
user968000
  • 1,765
  • 3
  • 22
  • 31

0 Answers0