Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- char sivan[100];
- gets(sivan);
- int countu=0;
- int countl=0;
- int i;
- for(i=0; sivan[i]!='\0'; i++)
- {
- if('A'<=sivan[i] && sivan[i]<='Z')
- countu++;
- else if('a'<=sivan[i] && sivan[i]<='z')
- countl++;
- }
- if(countu==countl)
- {
- i=0;
- while (sivan[i])
- {
- sivan[i] =tolower(sivan[i]);
- i++;
- printf("%c",sivan[i]);
- }
- }
- else if(countu>countl)
- {
- i=0;
- while (sivan[i])
- {
- sivan[i] =toupper(sivan[i]);
- i++;
- printf("%c",sivan[i]);
- }
- }
- else if(countl>countu)
- {
- i=0;
- while (sivan[i])
- {
- sivan[i] =tolower(sivan[i]);
- i++;
- printf("%c",sivan[i]);
- }
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment