Kawsar_Hossain

Problem-1

Jul 29th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     char a,str[100];
  5.     int i,c=0;
  6.     gets(str);
  7.     scanf("%c", &a);
  8.     for(i=0;str[i]!='\0';i++)
  9.     {
  10.         if(a==str[i])
  11.         {
  12.             c++;
  13.         }
  14.     }
  15.     printf("Frequency of the inputed character=%d\n", c);
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment