Skip to content

Instantly share code, notes, and snippets.

@ebubekirtrkr
Created June 17, 2021 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebubekirtrkr/157a1f729de3f9b5be54164eddd481c9 to your computer and use it in GitHub Desktop.
Save ebubekirtrkr/157a1f729de3f9b5be54164eddd481c9 to your computer and use it in GitHub Desktop.
2
#include <stdio.h>
#include <string.h>
//190410084
int main()
{
char cumle[255];
printf("Bir cümle girin: \n");
gets(cumle);
int cumle_uzunluk = strlen(cumle);
int k_sayisi = 0;
int l_sayisi = 0;
for (int i = 0; i < cumle_uzunluk; i++)
{
char c = cumle[i];
if (c == 'k' || c=='K')
k_sayisi++;
else if (c == 'l' || c=='L')
l_sayisi++;
}
printf("Cümledeki toplam harf sayisi: %d\n", cumle_uzunluk);
printf("Cümledeki k harflerinin sayisi: %d\n", k_sayisi);
printf("Cümledeki l harflerinin sayisi: %d\n", l_sayisi);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment