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
What is memcpy() function?
What is the difference between %d and %i?
Write a program that accept anumber in words
Is printf a keyword?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What are the header files used in c language?
what are bit fields? What is the use of bit fields in a structure declaration?
How to write c functions that modify head pointer of a linked list?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Which is better malloc or calloc?
In c language can we compile a program without main() function?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
write a c program for swapping two strings using pointer
How are variables declared in c?
How do you list a file’s date and time?