Commit 5a782711 by glkink

Add new file

parent 16e87b13
Showing with 52 additions and 0 deletions
#include <stdio.h>
#include <stdio.h>
#include <string.h>
int suurvaike(char s[], char ch, int kord) {
int c = 0;
int muudatus=0;
int i;
kord=strlen(s);
for(i=0;i<kord;i++){
while (s[c] != '\0') {
ch = s[c];
if (ch >= 'A' && ch <= 'Z')
s[c] = s[c] + 32;
else if (ch >= 'a' && ch <= 'z')
s[c] = s[c] - 32;
c++;
}
}
kord--;
i--;
return muudatus;
}
int main()
{
char string[100];
char ch=0;
int muudatus=0;
printf("Sisesta tahed:\n");
gets(string);
suurvaike(string, ch, muudatus);
printf("Tahed: %s\n", string);
printf("Muudatuste arv: %d\n", muudatus);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment