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 scope and lifetime of a variable in c?

1009


Can i use “int” data type to store the value 32768? Why?

1154


What is meant by type casting?

1031


What is the purpose of sprintf?

1085


to find the closest pair

2300


What is identifier in c?

980


When should the const modifier be used?

1069


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1223


What does *p++ do? What does it point to?

1017


What are identifiers in c?

1163


What is meant by type specifiers?

1094


What is the use of putchar function?

1033


What is the size of empty structure in c?

1039


can we change the default calling convention in c if yes than how.........?

2493


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1062