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 |
What are the 32 keywords in c?
Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates
implement general tree using link list
how the size of an integer is decided? - is it based on processor or compiler or OS?
19 Answers HCL, JPR, Microsoft, nvidia,
How do you override a defined macro?
program to convert a integer to string in c language'
What do the functions atoi(), itoa() and gcvt() do?
What is the difference between exit() and _exit()?
What is the purpose of void in c?
Write a program using two-dimensional array that lists the odd numbers and even numbers separately in a 12 input values.
How do we select the big element or any other operation from array which is read dynamically. user need to give the elements only no need to mention the size.
fun(int x) { if(x > 0) fun(x/2); printf("%d", x); } above function is called as: fun(10); what will it print? }