How to removing white spces in c programming only bu using
loops

Answer Posted / aravind

int main()
{
int i;
char str[10];
gets(str);
for(i=0;i<=number;i++)
{
if(str[i]==' ')
str[i]=0;
}
printf("string without white space is=%s",str);
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a memory leak? How to avoid it?

581


What is cohesion and coupling in c?

597


What standard functions are available to manipulate strings?

568


Explain #pragma statements.

608


What are the 3 types of structures?

576






What is meant by type specifiers?

663


Which header file is essential for using strcmp function?

947


What is the difference between array and pointer?

571


How can I write functions that take a variable number of arguments?

631


What are the general description for loop statement and available loop types in c?

691


Explain how do you convert strings to numbers in c?

598


Can you subtract pointers from each other? Why would you?

564


What is the difference between Printf(..) and sprint(...) ?

792


What are the types of data files?

735


Who is the main contributor in designing the c language after dennis ritchie?

557