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
  • 81,915
  • 7
  • 76
  • 137
user968000
  • 1,665
  • 3
  • 22
  • 29

0 Answers0