Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!