Skip to content

Instantly share code, notes, and snippets.

@fovelas
Created November 3, 2020 07:51
Show Gist options
  • Save fovelas/fa198c171cadb4a03896093d73e1f636 to your computer and use it in GitHub Desktop.
Save fovelas/fa198c171cadb4a03896093d73e1f636 to your computer and use it in GitHub Desktop.
C Programlama Girilen Cümlenin Baş Harflerini Alıp Yazdırmak
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
main() {
int i;
char cumle[100];
printf("cumle: ");
gets(cumle); // kullanicinin girdigi cumleyi alir
printf("\n");
for(i=0; i<strlen(cumle); i++){ // strlen(cumle) komutu cumlenin karakter uzunlugunun degerini alir
if(i==0) printf("%c",cumle[0]); // cumlenin ilk kelimesinin ilk harfini yazdirmak
if(cumle[i]==' ') printf("%c",cumle[i+1]); // bosluga denk geldiginde atlayarak bir sonraki karaktere gecer
}
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment