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 izbroj(char k[])
- {
- int i;
- for (i = 0; k[i] != '\0'; i++);
- return i;
- }
- void obrni(char k[], int n)
- {
- int i;
- char pom;
- for (i = 0; i < n / 2; i++)
- {
- pom = k[i];
- k[i] = k[n - 1 - i];
- k[n - 1 - i] = pom;
- }
- }
- int main()
- {
- char str[20];
- int duzina = 0;
- printf("Unesi string:");
- gets(str);
- duzina = izbroj(str);
- obrni(str, duzina);
- printf("%s", str);
- printf("\nduzina:%d", duzina);
- getchar();
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement