write a program to copy a string without using a string?
Answers were Sorted based on User's Feedback
Answer / balaji ganesh
#include<stdio.h>
#include<string.h>
void main()
{
char a[50],b[50];
int i,n=0;
clrscr();
printf("enter a string:");
while((a[n]=getchar())!='\n')
{
b[n]=a[n++];
}
for(i=0;i<n;i++)
printf("%c",b[i]);
getch();
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / j j ramesh
void main()
{
char str1[100],str2[100];
printf("ENTER THE STRING :");
gets(str1);
for(i=0;str1[i];i++)
str2[i] = str1[i]l
pritf("COPIED : %s",str2);
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Explain what is the difference between null and nul?
What is a nested formula?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX) x=1; else if(x<MIN) x=-1; x=50; if the initial value of x=200,what is the vlaue after executing this code? a.200 b.1 c.-1 d.50
What is the difference between c and python?
What is #define size in c?
Who had beaten up hooligan "CHAKULI" in his early college days?
hat is a pointer?
What is the size of empty structure in c?
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
What is static volatile in c?
How to implement a packet in C