Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C PROGRAM NEED SAME OUTPUT DONOT GIVE WRONG ANS OR IRRELEVALANT PROGRAM 1 - Squeeze the character in s1 that matches any character in the

C PROGRAM NEED SAME OUTPUT DONOT GIVE WRONG ANS OR IRRELEVALANT PROGRAM

1 - Squeeze the character in s1 that matches any character in the string s2

Description:

Read two strings s1 and s2 from user.

Remove the characters in s1 that matches with s2.

Input string:

string 1: Dennis Ritchie

string 2: Linux

Output String:

After squeeze s1: Des Rtche

Should not use extra array or the pointer

Pr-requisites:-

Functions

Pointers

Arrays

Objective: -

To understand the concept of

Functions

Pointers & strings

Arrays

Inputs: -

String1 and String2

Sample execution: - Test Case 1: Enter s1 : Dennis Ritchie Enter s2 : Linux After squeeze s1 : Des Rtche

Test Case 2: Enter s1 : Welcome Enter s2 : Emertxe After squeeze s1 : Wlco

requested file

#include

void squeeze(char [], char []);

int main() { char str1[30], str2[30]; printf("Enter string1:"); scanf("%[^ ]", str1);

printf("Enter string2:"); scanf("%[^ ]", str2); squeeze(str1, str2); printf("After squeeze s1 : %s ", str1); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions