write a program to copy a string without using a string?
Answer Posted / 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 |
Post New Answer View All Answers
What are the storage classes in C?
How do you declare a variable that will hold string values?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
write an algorithm to display a square matrix.
What is the g value paradox?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Explain why c is faster than c++?
What is the use of getchar functions?
Explain modulus operator.
What is the difference between test design and test case design?
i got 75% in all semester am i eligible for your company
Why is extern used in c?
What are the different types of errors?
Differentiate between Macro and ordinary definition.
What is an arrays?