Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h> /* stdin, printf, and fgets */
- #include <string.h> /* for all the new-fangled string functions */
- int main()
- {
- char string [30];
- char string2 [30];
- int i=0, k;
- printf("unesite prvi niz:\n");
- fgets(string, 15, stdin);
- k = strlen(string);
- printf("duzina majmuna je: %d\n", k);
- while (i<=15) {
- string2[k-1] = string[i];
- ++i;
- --k;
- }
- string2[k] = '\0';
- printf("obrnut niz je: %s", string2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement