task7.c Compare 2 strings function cmp will print out > if s1 is "bigger" than s2, < if s1 is "smaller than s2, = if s1 is "equal" to s2. */ #include #include void cmp(char *s1, char *s2){ return; } int main() { char *string1 = "UNIX rules!"; char *string2 = "Windows drools!"; cmp(string1,string2); return 0; } Start with task7.c, implement the cmp() function. The goal of this function is to compare two strings using the sum of the ASCII value of all the characters in each string. Output of your program should look like this: UNIX rules! is smaller than Windows drools!
task7.c Compare 2 strings function cmp will print out > if s1 is "bigger" than s2, < if s1 is "smaller than s2, = if s1 is "equal" to s2. */ #include #include void cmp(char *s1, char *s2){ return; } int main() { char *string1 = "UNIX rules!"; char *string2 = "Windows drools!"; cmp(string1,string2); return 0; } Start with task7.c, implement the cmp() function. The goal of this function is to compare two strings using the sum of the ASCII value of all the characters in each string. Output of your program should look like this: UNIX rules! is smaller than Windows drools!
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
Related questions
Question
task7.c
Compare 2 strings
function cmp will print out
> if s1 is "bigger" than s2,
< if s1 is "smaller than s2,
= if s1 is "equal" to s2.
*/
#include <stdio.h>
#include <string.h>
void cmp(char *s1, char *s2){
return;
}
int main()
{
char *string1 = "UNIX rules!";
char *string2 = "Windows drools!";
cmp(string1,string2);
return 0;
}
Start with task7.c, implement the cmp() function.
The goal of this function is to compare two strings using the sum of the ASCII value of all the characters in each string. Output of your program should look like this:
UNIX rules! is smaller than Windows drools!
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT