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 |
write a program that will print %d in the output screen??
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]
what is the output for this question: main() { int i=1; printf("%d%d%d",i,i++,++i); }
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
what is memory leak?
difference of two no's with out using - operator
Why cant I open a file by its explicit path?
what is the use of operator ^ in C ? and how it works?
What is the modulus operator?
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
what is c programing
What is the use of linkage in c language?