Answer to Question #173905 in C for R SWASTHIK

Question #173905

Write a C program to copy one string to another without using string manipualtion fucntion


1
Expert's answer
2021-03-24T01:55:53-0400
#include <stdio.h>
#include <stdlib.h>


//The start point of the program
int main() { 
	char inputString[1000];
    char copyString[1000];
    int i;
    printf("Enter any string: ");
    gets(inputString);
    
    /* Copy text1 to text2 character by character */
    for(i=0; inputString[i]!='\0'; i++)
    {
        copyString[i] = inputString[i];
    }
    copyString[i] = '\0';


  
    printf("Copy string: %s\n", copyString);
	//delay
	getchar();
	getchar();
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS