Write A Program to copy one String into Another and Count the number of Characters Copied
#include<stdio.h> #include<conio.h> void main ( ) { char str1 [80], str 2 [80]; int i ; printf (“enter a string ...
https://www.computersprofessor.com/2016/06/write-program-to-copy-one-string-into.html
#include<stdio.h>
#include<conio.h>
void main ( )
{
char str1 [80], str 2 [80];
int i ;
printf (“enter a string \n”);
scanf (“%s” str 2);
for ( i =0; str 2[i]! = ‘\0’, i++)
str 1 [i] = str 2[i];
str 1 [i] = ‘\0’;
printf (“\n % s \n “ , str1);
printf (“number of characters = %d \n “ i);
getch();
}
enter a string computer
computer
number of characters = 8