CHANGE THE CODE BY USING DIFFERENT LOGICS. BUT SHOULD GET SAME OUTPUT AS PROVIDED CODE.   #include #include void main() {     char s1[100],s2[100];     int max=0,i,j;     printf("Enter the First string:");     scanf("%s",&s1);     printf("Enter the Second string:");     scanf("%s",&s2);     char c=s2[0];     for(i=0;s2[i]!='\0';i++)     {         int count=0;         for(j=0;s1[j]!='\0';j++)         {             if(s2[i]==s1[j])             {                 count+=1;             }         }         if(max

Question

CHANGE THE CODE BY USING DIFFERENT LOGICS. BUT SHOULD GET SAME OUTPUT AS PROVIDED CODE.

 

#include<stdio.h>

#include<conio.h>

void main()

{

    char s1[100],s2[100];

    int max=0,i,j;

    printf("Enter the First string:");

    scanf("%s",&s1);

    printf("Enter the Second string:");

    scanf("%s",&s2);

    char c=s2[0];

    for(i=0;s2[i]!='\0';i++)

    {

        int count=0;

        for(j=0;s1[j]!='\0';j++)

        {

            if(s2[i]==s1[j])

            {

                count+=1;

            }

        }

        if(max<count)

        {

            max=count;

            c=s2[i];

        }

    }

    printf("The Max count character is:%c",c);

    getch();

}

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Engineering

Programing

Related Computer Engineering Q&A

Find answers to questions asked by students like you.

Q: Consider the following schema ,write the relational algebra queries for the following: Supplier(sid,...

A: Every database management system must define a query language to allow users to access the data stor...

Q: How does artificial intelligence bring a new possibility to IT security? Need 3 examples

A: Cyber attacks (defense against hackers and software error The software that powers our computers an...

Q: Q1. Write a program to enter 10 numbers using keyboard and put them in an array. Now generate anothe...

A: Note:- Since you have not specified the programming choice, we will be solving this question in pyth...

Q: Give code in c++ language and each secreenshots

A: Please find the answer below :

Q: A bit string, 0111101111101111110, needs to be transmitted at the data link layer. What is the strin...

A: Actually,  Bit stuffing is the insertion of non information bits into data

Q: 1. Develop Recursion to recursive algorithm to find the smallest and largest element in an array and...

A: In implementing a recursive algorithm to find the minimum element in the array, we can just modify i...

Q: Draw a annotated parse tree for the string: a=b/(c-d)*(x+y)

A: Parse tree is a graphical representation of the replacement process in a derivation. Each interior n...

Q: Write a program which should consists of a user defined function “fun ()” [Function returns no value...

A: Store the index where the element is found If index is same as initial index which means element not...

Q: Help me to make flowchart for my python code. ####################################### string1="the q...

A: #Initialize four strings string1="the quick brown fox jumps over the lazy dog"string2="esp bftnx mcz...

Q: Suppose we are talking about a mysterious number called Opaque Number. Any positive integer is Opaqu...

A: The program prompts the user to enter a number. A while loop is used for finding the length of the n...

Q: A data of 700 kbps is to be transmitted over a channel of 5 kHz bandwidth and 200 kbps capacity. The...

A: Given Data : Data Amount  =  700kb Channel bandwidth = 5kHz Channel Transfer Rate = 200kbps To find ...

Q: 1. Write a program which should consists of a user defined function “Task ()” [Function returns no v...

A: You haven't mentioned the programming language. So, we are answering this question using C. Program ...

Q: Please provide reasoning for each choice and finally help me with the correct question. Thank you.

A: answer is given below 

Q: Answer the following question: Which AVG feature scans every single file as it is opened, saved, or ...

A: AVG is an antivirus software that can be enabled in the user devices which helps to protect from all...

Q: Computer Engineering Question

A: Hey, since multiple questions posted, we will answer first question according to our policy. If you ...

Q: Code using C Programming.

A: The problem is to be solved in the form of a c program where the user will be prompted to input two ...

Q: This is a PYTHON question, I need the problem really step by step, careful solving with all comments...

A: GIVEN: Create a python program that returns the largest digit in a number.   SAMPLE INPUT AND OUTPUT...

Q: 31. For the MyMy1 queueing model, why do the followingresults hold? (Hint: Remember that 1ym is the ...

A: a) Here Adding 1 on both sides, So finally it will be:

Q: What is the difference between void and NULL pointers .Give suitable examples in support of your ans...

A: Void pointer: A void pointer is one which does not have any data type associated with it, i.e. it c...

Q: From your laptop, you need to remote into a switch to make some configuration changes.Which Transpor...

A: A socket is an internal endpoint for sending or receiving information within a node on a computer ne...

Q: Describe categories of computers and mobile devices, and identify general characteristics of size, u...

A: The categories of Computers can be classified as :   Minicomputer: A computer supporting multiple u...

Q: Write an application that displays a series of at least eight student ID numbers (that you have stor...

A: File name: “GradeException.java” //Define the GradeException class that extends "Exception" class pu...

Q: Write a program which should consists of a user defined function "Task ()” [Function returns no valu...

A: You haven't mentioned the programming language. So, we are answering this question using C. Program ...

Q: Create a lottery game application and name the program as LotteryGame.java. Generate three random nu...

A: import java.util.Random;import java.util.Scanner; public class LotteryGame{        private int numbe...

Q: Write a C program to find out year in which Mr. Kavi was born from the following information: Kavi ...

A: Algorithm 1.take input value of m( how many year kavi is younger then his mother) 2. take value of y...

Q: Describe in detail the direct and indirect measures of quality in software

A: It comes under classification of the Software Measurements. The measurement of software is a titrati...

Q: Give the properties of “trustworthy”encryption system.

A: Encryption is basically a way by which the confidential information is converted into a secret code ...

Q: 1. Write a C program to count  Non-Armstrong numbers from m and n (including m and n also) using the...

A: Note- since part 2 of question does not provide information for programming language so we assume th...

Q: Find the operating frequency that allows 481-byte packets to run at line rate if the port speed is 4...

A: In the given question operating frequency need to be found i.e number of bits generated per unit tim...

Q: Use C++: Develop a Tic Tac Toe game that will match a player against the computer. Do’s: Use a typi...

A: As per question we use only  Program must use: functions  loops  branching  string functions 

Q: Discuss various ways of initialising 1D and 2D arrays in C. Also discuss their memory representation...

A: An array of arrays is known as 2D array. The two dimensional (2D) array in C programming is also kno...

Q: Write a C/C++ program that calculates the least squares line for two sets of values. The program con...

A: The program is written in c++

Q: “Pseudocode is a step by step written outline of your code that you can gradually transcribe into th...

A: Here first the flowchart is developed followed by the algorithm or the pseudo code to check whether ...

Q: Robotic process automation offers all of the following advantages except:   a. Improved accur...

A: The robotic automation process' main disadvantage for given points is Increasing cost. Therefore, th...

Q: ALSO: What is the hit ratio for the memory accesses (Round to the nearest percent.)

A: Solution is in Step 2.

Q: In Networks and Cloud Computing, how is the Internet of Everything (loE) different from the Internet...

A: While they are often intertwined and certain elements of their evolution have taken place together t...

Q: Write a program to process a collection of daily high temperatures. It will take 24 temperature valu...

A: Actually, program is a executable software that runs on a computer.