Page 1 of 1

Write a C program to implement the following requirement: Input: The program will read from standard input 2 strings s1

Posted: Fri May 20, 2022 4:38 pm
by answerhappygod
Write a C program to implement the following requirement:
Input: The program will read from standard
input 2 strings s1 and s2 separated by a new line character ‘\n’.
Each string has a maximum of 100 characters and there is no space
in the string. Note: The input does not end with a new line ‘\n’.
Output: The program will print to standard output
“1” if s1 is a prefix of s2, and “0” otherwise. An empty string is
a prefix of every string.
Write A C Program To Implement The Following Requirement Input The Program Will Read From Standard Input 2 Strings S1 1
Write A C Program To Implement The Following Requirement Input The Program Will Read From Standard Input 2 Strings S1 1 (327.08 KiB) Viewed 33 times
Write a C program to implement the following requirement: Input: The program will read from standard input 2 strings s1 and s2 separated by a new line character '\n'. Each string has a maximum of 100 characters and there is no space in the string. Note: The input does not end with a new line '\n'. Output: The program will print to standard output “1” if s1 is a prefix of s2, and “O” otherwise. An empty string is a prefix of every string. SAMPLE INPUT 1 abc abcde SAMPLE OUTPUT 1 1 SAMPLE INPUT 2 abc def SAMPLE OUTPUT 2 0