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 is difference between Structure and Unions?
What is the modulus operator?
Explain what is the difference between far and near ?
How can I change the size of the dynamically allocated array?
Write a code to generate divisors of an integer?
What type of function is main ()?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
What are c preprocessors?
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
Explain union.
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
Why can’t constant values be used to define an array’s initial size?
What are the various types of control structures in programming?
What is difference between structure and union in c programming?