Playing With Characters | HackerRank - Samsus Salehin Sabbir

Header Ads

Playing With Characters | HackerRank


Problem Link : Playing With Characters

Solution :
      Develop by
 Samsus Salehin Sabbir 




  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <stdlib.h>

  5. int main() 
  6. {
  7.     // declaration
  8.     char ch;
  9.     char s[100];
  10.     char sen[100];
  11.     scanf("%c",&ch); // for one character read
  12.     scanf("\n"); // for 2nd time newline
  13.     scanf("%[^\n]%*c", s);
  14.     scanf("\n");
  15.     scanf("%[^\n]%*c", sen);
  16.     printf("%c\n",ch);
  17.     printf("%s\n",s);
  18.     printf("%s\n",sen);
  19.     return 0;
  20. }

No comments

Powered by Blogger.