README.md
December 4, 2022 ยท View on GitHub
Description
Just a small program to flip a string
More Info
| Submitted On | |
| By | Matthew Thomson |
| Level | Beginner |
| User Rating | 5.0 (10 globes from 2 users) |
| Compatibility | C, C++ (general), Microsoft Visual C++ |
| Category | Strings |
| World | C / C++ |
| Archive File |
Source Code
// stringflip.c : Defines the entry point for the console application.
//
#include "stdafx.h" //C users delete this line
#include<string.h>
#include<stdio.h>
#include<conio.h>
void main()
{
char name[25]; char backwards[25];
int j, i, k;
printf("Please enter your name > ");
gets(name);
j = i = strlen(name);
for(k = 0; k <= j-1; k++)
{
backwards[k] = name[i-1];
i--;
}//end for
backwards[k] = '\0';
printf(backwards);
printf("\n");
}//end main