Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 “ Note: one .=1 Space
Output: "We Are Student"

Answer Posted / jyotsna

/* Assume ' ' at the place of '.' */

#include<conio.h>
#include<stdio.h>
void main()
{
char *s="Hello...this...is...jyotsna";
int i=0;
clrscr();

while(*s!='\0')
{
if(*s!='.')
{
printf("%c",*s);
i=0;
s++;
}
else
{
while(*s=='.')
s++;

printf(".");
}
}
getch();
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you delete a node in DLL?

1301


What is the difference between malloc() and calloc()?

1878


What is the purpose of clrscr () printf () and getch ()?

1074


What is meant by 'bit masking'?

1397


What is the best way to store flag values in a program?

1089


What are 3 types of structures?

1074


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2455


Why string is used in c?

1015


Is flag a keyword in c?

1161


What is difference between class and structure?

1123


diff between exptected result and requirement?

2068


What is the difference between exit() and _exit() function in c?

1083


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1070


Why is c used in embedded systems?

1130


What does d mean?

1105