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 |
write a program to print data of 5 five students with structures?
Was 2000 a leap year?
What is difference between constant pointer and constant variable?
Write a program in C for showing working of different logical operator in C. Your program should guide users with proper message/menu on the console.
What is the deal on sprintf_s return value?
Differentiate between null and void pointers.
number of times a digit is present in a number
write a program in c language for the multiplication of two matrices using pointers?
Is it better to use malloc() or calloc()?
main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }
5 Answers Amazon, HCL, Thought Works,
Mention four important string handling functions in c languages .
Write a C program to find the smallest of three integers, without using any of the comparision operators.