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!

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
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
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack operations
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT