Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- int main()
- {
- FILE *fPointer;
- if((fPointer=fopen("text.txt","r"))==NULL)
- {
- printf("Datotekata ne moze da se otvori.");
- return -1;
- }
- char c,niza[1000];
- int brojac1=0,brojac2=0;
- while((c=fgetc(fPointer))!=EOF)
- {
- if(isupper(c))
- {
- brojac1++;
- }
- if(islower(c))
- {
- brojac2++;
- }
- }
- printf("%.4f\n%.4f",(float)brojac1/(brojac1+brojac2),(float)brojac2/(brojac1+brojac2));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement