Advertisement
2_2002-2004 Debugging and Error Handling #127446

String Flip

Just a small program to flip a string

AI

Tóm tắt bởi AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Mã nguồn
original-source
// 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
Upload
Bình luận gốc (3)
Được khôi phục từ Wayback Machine