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