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
What is the difference between delete and backspace key?​
vladimir2022 [97]
They are the same thing
5 0
3 years ago
Read 2 more answers
Please tell fast plzzzzzz.​
lana [24]

Answer:

True

Explanation:

4 0
3 years ago
Make a webpage that shows news <br>​
Nataly_w [17]
Well it all depends how you plan on making it as you would need to know Web Development or you could just copy paste code from YT
8 0
3 years ago
As a student, why do you need to know and follow the steps printing a <br><br>document?​
Kazeer [188]
So I am able to print my math notes and keep up in geometry.
7 0
3 years ago
Read 2 more answers
How does ur computer know that its cursor moved
Anton [14]
The sensor of a mouse connected to the computer or the touch pad being touched and swiped around on
8 0
3 years ago
Read 2 more answers
Other questions:
  • video-sharing sotes such as youtube and vimeo provide a place to post short videos called clips true or false?
    5·1 answer
  • Your boss asks you to work through the weekend to install new software on the applications server that serves up applications to
    15·2 answers
  • How is a cell named?
    12·1 answer
  • What should be used to clean LCD monitors? Liquid window cleaner Ammonia wipes Windshield washer liquid Antistatic monitor wipes
    15·1 answer
  • For what kind of shot is a fisheye lens most appropriate?
    8·1 answer
  • When using the Internet, it is important to know the validity of web page you are using. How can you know if the information is
    5·1 answer
  • A unique ability of people which sets them far apart from animals is:
    8·1 answer
  • 1) Identify at least four examples and uses of application software.​
    5·2 answers
  • The physical layer of the OSI model is not foundational to any of the other layers. True or False
    8·1 answer
  • You have been asked to analyze the Excel data provided by your IT department. You would like to have the ability to sort and fil
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!