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 |
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
what is an inline fuction??
What is encapsulation?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
Write program to remove duplicate in an array?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
Do you know the use of fflush() function?
An array name contains base address of the array. Can we change the base address of the array?
write c program without semicolon
11 Answers MindTech, TCS, Wipro,
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
write a program that uses point of sale system. which are mainly used by retail markets, where the is a database inventory list, a slip should be printed for the customer. manage should be able to access what has been sold and what is left from stock?
What is the use of gets and puts?