1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Darina [25.2K]
3 years ago
8

In C, how could I use a command line input to remove certain characters from an existing string? For example, if I have string '

OXOXO' and whenever the character 'N' is put into the command line, a character from the existing string would be removed. So if the user inputs the string 'oNoN' into the command line, the new string would be 'OXO'.

Computers and Technology
1 answer:
s344n2d4d5 [400]3 years ago
6 0

Answer:

// here is code in C.

#include <stdio.h>

// main function which take input from command line

int main(int argc, char** argv) {

               // variables

               int char_count = 0, i=0;

               // string as char array

               char inp_str[100] = "OXOXO";

               //count  total number of 'N's in command line argument

               while(argv[1][i++] != '\0')

               {

                 if(argv[1][i]=='N')

                     char_count++;

               }

               // find the length string

               int l = 0;

               while(inp_str[l] != '\0')

                               l++;

               //reduce length of the string

               l = l - char_count;

               //set null char at index "l" so it will  removes character after index "l"

               inp_str[l] = '\0';

               printf("%s\n", inp_str);

               return 0;

}

Explanation:

Create a string as character array and initialize it with "OXOXO".After that count the number of "N" which come from the command line argument.Then find the length of input string.Reduce the length of string and set "null" at index "l" in the string.Then print the string.

Output:

OXO

<u>Command line argument:</u>

You might be interested in
A(n) ____is a network of organizations and activities needed to obtain materials and other resources, produce final products, an
Oliga [24]

Answer:

c. supply chain

Explanation:

A supply chain in commerce, is a network of organizations and activities needed to obtain materials and other resources, produce final products, and get those products to their final users.

8 0
4 years ago
I need help also this counts as my second giveaway and last for today
kifflom [539]

Answer:

I am pretty sure its the Visual card

8 0
3 years ago
Read 2 more answers
When choosing a buffer to use for an experiment conducted at pH 5.3, it would be best to choose one with a pKa of: A.2.14. B.4.7
s344n2d4d5 [400]

Answer:

B.4.75

Explanation:

Buffer solutions are the solutions which can resist the change in the pH up to some extent. They are the solutions of either weak acid and conjugate base of it or weak base and conjugate acid of it.

The pH of a buffer solution can be measured by the equation known as Henderson–Hasselbalch equation.

pH=pKa+log[base]/[acid]

A good buffer that buffer which has its acid's pKa within one pH unit of desired experimental conditions.

Thus, desired pH = 5.3

Preferable pKa = 4.3 - 6.3

<u>Answer - B. 4.75</u>

7 0
4 years ago
Write a detailed three page report that summarizes how data scientists are utilizing data mining to predict future trends and be
LiRa [457]

Answer: given in the explanation

Explanation:

Data mining is referred as an automated processing tool used for sorting and analyzing enormous data and information which indeed are ``aimed towards effectively identifying trends and patterns and establishing relationships to solve business problems and generate new opportunities. Furthermore data mining techniques also helps to predict what’s going to happen in the future and act accordingly to take benefit of forthcoming tendencies.

Data mining is applied to a variety of large-scale data-processing activities such as collecting, extracting, warehousing and analyzing data. It also includes decision-support applications and technologies such as business artificial intelligence and machine learning and is used in varied areas of business research such as product development, sales and marketing etc.

Data mining is for taking advantage of data to predict ;

  • Mathematical algorithms, and, data are used for predictive analytics. One can capture information, and, use it to model sales pattern, trends, and, customer behaviour
  • Data mining uses algorithms to extract, and, analyze information; discover hidden patterns
  • It uses data patterns, and, is thus closely tied to machine learning
  • Historical & current information is used to predict future trends

Data mining can be used for the following:

  • Data mining in gas & oil operations - Mining data in gas & oil operations involves committing to key technologies, and, processes; and, embracing new ways of thinking & problem-solving. Firms can use exploratory data analysis, modelling techniques & model development; approaches to put models into production
  • Big data - Performance computing & advanced analytics
  • Magic Quadrant - Evaluate 16 vendors to identify the right ones
  • Heavy reading, network analytics - Optimize network; evaluate network performance; provide targeted marketing; fine-tune capacity.

5 0
4 years ago
What does this mean “Fatal error: Uncaught exception 'Thrift\Exception\TTransportException' with message 'THttpClient: Could not
hodyreva [135]
You could try turning your pc completely off then back on or redownloading your browser
3 0
4 years ago
Other questions:
  • Hen pointing to a tool on the ribbon, a ______ appears, displaying information about the tool.
    7·1 answer
  • The purpose of the ________ element is to describe the contents of a table.
    15·1 answer
  • _____ performs a real-time lookup of a digital certificate’s status. Group of answer choices Certificate Revocation List (CRL) R
    6·1 answer
  • Controls that are used to assess whether anything went wrong, such as unauthorized access attempts, are called ________ controls
    5·2 answers
  • Which of the following is a valid format symbol in Microsoft Excel? Dollar Sign, Comma, Percent Sign or all of them? I can't fig
    14·1 answer
  • 2
    9·2 answers
  • What do green squiggly lines under text indicate?
    14·1 answer
  • The greater the profit motive in an economic system , the greater the likelihood of a.Innovation b.Equity c.Security d.Governmen
    15·1 answer
  • What is the best memory to be used? Why?
    8·1 answer
  • 4. Write a program to calculate square root and<br>cube root of an entered number .​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!