Write a program that accepts a string where multiple spaces
are given in between the words. Print the string ignoring
the multiple spaces.
Example:
Input: “ We Are Student “
Output: "We Are Student"
#include<stdio.h>
main()
{
char *p, *q, *q1;
p = (char *)malloc(200);
q = (char *)malloc(200);
q1 = q;
printf("ENTER THE SENTENCE: \n");
p = gets(p);
while(*p != '\0')
{
if(*p != ' ' || *(q -1) != ' ')
{
*q++ = *p++;
}
else
p++;
}
*q = '\0';
printf("%s", q1);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Example of friendly function in c++
What is the g value paradox?
write an interactive program to generate the divisors of a given integer.
What is s or c?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0; } a)0 1 6 2 b)0 1 6 7 c)Compilation error d)None of the above
const char * char * const What is the differnce between the above tow?.
How does selection sort work in c?
What is the code for 3 questions and answer check in VisualBasic.Net?
how to swap two nubers by using a function with pointers?
wat are the two methods for swapping two numbers without using temp variable??
Explain can the sizeof operator be used to tell the size of an array passed to a function?