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
}