This document outlines an assignment to write a program that replaces multiple spaces in a string with a single space. It provides examples of input strings like "Welcome to Emertxe" and the expected output. It also describes the algorithm to check if the next character is a space when a space or tab is encountered, and to swap elements back one position if so. Pre-requisites like functions, pointers, arrays are listed, with the objective being to understand these concepts.
4. Assignment 1
WAP to replace each string of one or more blanks by a
single blank
5. Assignment 1
WAP to replace each string of one or more blanks by a
single blank
Input:
6. Assignment 1
WAP to replace each string of one or more blanks by a
single blank
Input: String with multi-spaces between words
7. Assignment 1
WAP to replace each string of one or more blanks by a
single blank
Input: String with multi-spaces between words
Output:
8. Assignment 1
WAP to replace each string of one or more blanks by a
single blank
Input: String with multi-spaces between words
Output: Print each string after replacing one or more
blanks by a single blank.
11. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
12. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
14. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
15. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
16. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
18. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
19. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
21. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
22. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
24. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back
25. Assignment 1
Example’s:
W e l c o m e t o e m e r t x e 0
⮚Input: Welcome to Emertxe
If space or tab is encountered
check the next character, if the
next character is also a space,
then swap all the elements one
step back