How to receive strings with spaces in scanf()

Answer Posted / parmjeet kumar

#include<stdio.h>
#include<conio.h>
void main()
{
char a[50];
printf("enter the string:");
scanf("%s",&a);
printf("%s",a);
getch();
}

Is This Answer Correct ?    0 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is methods in c?

649


How #define works?

624


What is the condition that is applied with ?: Operator?

667


Describe the modifier in c?

610


How do you do dynamic memory allocation in C applications?

634






When should a far pointer be used?

607


What is context in c?

543


Explain goto?

722


Why is c faster?

596


How can a number be converted to a string?

611


What is assert and when would I use it?

585


What is the use of parallelize in spark?

582


What is the difference between array and linked list in c?

606


What does 3 periods mean in texting?

604


What is the deal on sprintf_s return value?

647