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
In a wide area network (WAN), how would you troubleshoot an issue with the domain name system (DNS)?
NISA [10]
<span>C. Get the help of someone with specialized knowledge in the area.</span>
3 0
3 years ago
Read 2 more answers
The explicit location make the query easier to understand and interpret
Step2247 [10]

I am assuming this is a true or false question? If so, the answer is true.

6 0
3 years ago
What is this on G00gel Documents , how do I fix it?
mylen [45]

Answer:

Sorry but it donest show the picture

Explanation:

7 0
2 years ago
Loops are frequently used to ____; that is, to make sure it is meaningful and useful.
vitfil [10]

Loops are frequently used to<u> validate data </u>that is, to make sure it is meaningful and useful.

<h3>What are common blunders made by programmers in coding loops?</h3>

Forgetting to initialize and alter the loop control variable are common mistakes that programmers occasionally make. One set of instructions operates on multiple, separate sets of data. Initialized before joining a while loop.

<h3>What are the three steps that should occur in every loop?</h3>
  • Provide a starting value for the variable that will contain the loop.
  • Test the loop control variable to decide whether the loop body executes.
  • Alter the loop rule variable.

To learn more about Loops , refer

brainly.com/question/19344465

#SPJ4

4 0
2 years ago
How is a high-level programming language interpreted?
balu736 [363]

Answer:

Once a program is compiled, the chore of language translation is over with and therefore executing the program only requires execution time, not additional translation time. To execute an interpreted program, every instruction is translated first and then executed; this must be done every time the program is run.

Explanation:

8 0
2 years ago
Other questions:
  • Discussion group may have a___________ who monitors the postings and enforces the sides rules​
    13·1 answer
  • In which job role would a course in 3D modeling help with professional career prospects?
    9·2 answers
  • A(n ____ is used to describe the characteristics of data used in a database or other type of computer system.
    12·2 answers
  • _ models are non visual ways of communicating how someone thinks about something in the natural world
    12·1 answer
  • Can some one help sorry I just so confused on this and I keep failing it I just need the help So choose the best answers
    12·1 answer
  • A 5-stage MIPS pipeline has a register file without forwarding mechanism. How many NOPs (or bubbles) will you need to add to mak
    9·1 answer
  • The physical part or components of a computer system called​
    5·2 answers
  • IF YOU COULD CREATE A SOCIAL NETWORK:, what would it be like? What would make it so special about the others? (If you want you c
    9·1 answer
  • All of the following are characteristics of a 4 year college except
    11·2 answers
  • Who plays Pokemon Go if you do put your code in your answer so I can friend you.<br><br><br> o_o
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!