Skip to content

Instantly share code, notes, and snippets.

@harconst
Created June 1, 2018 11:26
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 harconst/9867793e4d9e2b2ad88c5a6593db0a2a to your computer and use it in GitHub Desktop.
Save harconst/9867793e4d9e2b2ad88c5a6593db0a2a to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char frash[30];
int i, mikos, plithos, arithmos;
printf("Dwse th frash sou\n");
fgets(frash, 30, stdin);
printf("Pliktrologises: %s\n", frash);
mikos = strlen(frash);
if (mikos < 20) {
printf("I frasi pou edwses einai mikri\n");
} else {
printf("I frasi pou edwses einai megali\n");
}
if (mikos % 4 == 0) {
printf("To mikos tis frasis einai pollaplasio tou 4\n");
}
printf("dwse ena arithmo anamesa sto 65 kai to 90\n");
scanf("%d", &arithmos);
while(arithmos < 65 || arithmos > 90) {
printf("Lathos eisodos. Ksanadwse ena arithmo anamesa sto 65 kai to 90\n");
scanf("%d", &arithmos);
}
for (i=0; i<mikos;i++) {
if (frash[i] == arithmos) {
plithos++;
}
}
printf("o xaraktiras vrethike %d fores\n", plithos);
system("PAUSE");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment