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 are the types of data structures in c?

610


Is there any possibility to create customized header file with c programming language?

634


What does c mean before a date?

603


What is a pointer variable in c language?

653


What are c preprocessors?

687






What are keywords in c with examples?

617


Write a factorial program using C.

657


What is the difference between test design and test case design?

1583


Explain what is a program flowchart and explain how does it help in writing a program?

658


How can I find the modification date of a file?

713


Why is %d used in c?

575


What is an identifier?

634


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

721


How many types of operator or there in c?

613


Explain the use of 'auto' keyword

688