Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to receive strings with spaces in scanf()

Answer Posted / suman halder

#include<stdio.h>
int main()
{
char str[100];
scanf("%[^\n]s",str);

}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the newline escape sequence?

1078


What is the difference between strcpy() and memcpy() function in c programming?

1090


How can I implement sets or arrays of bits?

1047


What type of function is main ()?

1046


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1887


Explain what are header files and explain what are its uses in c programming?

1159


Which programming language is best for getting job 2020?

1052


Explain what is wrong with this statement? Myname = ?robin?;

1588


What are logical errors and how does it differ from syntax errors?

1302


Is c is a middle level language?

1068


Explain how do you declare an array that will hold more than 64kb of data?

1455


What is the benefit of using an enum rather than a #define constant?

1241


What is context in c?

924


How to get string length of given string in c?

1067


Is it possible to initialize a variable at the time it was declared?

1220