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

Answer Posted / ranj

Aravind has done few mistake in printing the no,
the correct format should like this

int main()
{
int i,number;
char str[10];
gets(str);
number=strlen(str);
printf("String without white space\n");
for(i=0;i<number;i++)
{
if(str[i]==' ');
else
printf("%c",str[i]);
}
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does struct work in c?

613


What are different types of variables in c?

573


Why clrscr is used in c?

593


What is the sizeof () operator?

626


What are the types of data files?

735






Explain how do you print an address?

661


What is the size of array float a(10)?

659


What is else if ladder?

616


How can you find the day of the week given the date?

623


Write a C program to count the number of email on text

1422


Write a program to check armstrong number in c?

642


What is a memory leak? How to avoid it?

581


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2338


Tell me about low level programming languages.

649


What is #include stdio h and #include conio h?

605