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
DaniilM [7]
3 years ago
6

Write a function called countstuff () that takes as a parameter a character array, and returns an int. The prototype must be:

Computers and Technology
1 answer:
PSYCHO15rus [73]3 years ago
5 0

Answer:

Please kindly go to the explanation part.

Explanation:

The required function is written in Raw code below.

Function:

#include<stdio.h>

#include<ctype.h> //including required libraries

int countstuff(char s[]){ //Function countstuff

int cntUp=0,cntLow =0,cntDigits = 0,i=0,value; //declaring required variables

for(i=0;s[i]!='\0';i++){ //loop to iterate over the characters of string

if(isupper(s[i])){

cntUp++; //incrementing count of uppercase if it is uppercase character

}

else if(islower(s[i])){

cntLow++; //incrementing count of lowercase if it is lowercase character

}

else if(isdigit(s[i])){

cntDigits++; //incrementing count of digits if it is digit

}

}

value = cntUp*1000000 + cntLow*1000 + cntDigits; //counting value using formula given in question

return value; //returning the value

}

void main(){

char string[1000]; //declaring required variables

int value;

printf("Enter a String:");

scanf("%[^\n]s",string); //taking string as input

value = countstuff(string); //calling function

printf("The Value is : %d\n",value); //printing result

}

You might be interested in
Annabella was giving a presentation to a group of 20 real estate agents on
podryga [215]

Anticipate questions.

3 0
3 years ago
Read 2 more answers
What is an example of a hard skill?
Serjik [45]
3 would be self management
4 0
3 years ago
Read 2 more answers
Add me on fornite buddies Lynn_.25
Anna007 [38]

i- why would u ask that

Explanation:

6 0
3 years ago
Read 2 more answers
For each of the following languages, state with justification whether it isrecognizableor unrecognizable.(a)LHALT≥376={(〈M〉, x)
Scilla [17]

Answer:

See the picture attached

Explanation:

4 0
3 years ago
What will be the output of the following query on the table below?
shtirl [24]

Answer:

b

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Mark, David, Tia, and Ashley are team members in a computer programming class. They have been assigned the task of creating a co
    12·1 answer
  • Please help?!
    11·2 answers
  • All users on the network have antivirus software; however, several users report that they have what an administrator described a
    10·1 answer
  • Method x1() has code that calls method x2(). Method x2() has the following header.
    7·1 answer
  • Explain what a wiki is and list its advantages.
    5·1 answer
  • Lol who look at this so funny
    6·1 answer
  • A text file has been transferred from a Windows system to a Unix system, leaving it with the wrong line termination. This mistak
    15·1 answer
  • Which are print settings that can be modified in word 2019 choose two answers​
    8·1 answer
  • Create a set of functions that compute the mean, median, and mode of a set of
    8·2 answers
  • A type of attack where the adversary intercepts network packets, modifies them, and inserts them back into the network is called
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!