write C program that contains a function that gets a string as a
parameter and returns an integer value represents the number of
uppercase letters in this string
example : "AbcDeFgh" output:"3"
Answer:
#include<stdio.h>
int main() {
int upper = 0;
char ch[80];
int i;
printf("\nEnter The String : ");
gets(ch);
i = 0;
while (ch[i] != '') {
if (ch[i] >= 'A' && ch[i] <= 'Z')
upper++;
i++;
}
printf("\nUppercase Letters : %d", upper);
return (0);
}
Explanation:
|
if(ch[i]>='A' && ch[i]< ='Z') |
Output:

Thanks....
write C program that contains a function that gets a string as a parameter and returns...
c++ Write a function Count_m_z that takes a string as an input parameter argument and counts the number of m, n, o, ... z characters in it. The function returns an integer value for the number of times those 14 lowercase letters appear in the input string. Your function should be named Count_m_z Your function should take one string parameter Your function should return the number of m, n, o, ... z characters as an integer Your function should not...
(C++ only) Write a function that returns a decimal number from a binary string. The function header is as follows: int bin2Dec(const string& binaryString) For example, bin2Dec("10001") returns 17. Write a test program that prompts the user to enter a binary number as a string and displays its decimal equivalent value Sample Input: 1110100110101 Sample Output: Enter a bianry number: 1110100110101 7477
use c code to Develop a function void printToggled(char str[]) that gets a string as a parameter and prints every lowercase character as an uppercase one and vise versa. For example, if the string submitted as a parameter is Hello WorlD! The function should print hELLO wORLd! Hint:answer must include output
1-a-write a function that gets a number as a parameter and returns all its divisors (assume not more than 10 ) b- write a C program that reads two values from the above and prints their common divisors
write a c program
14. Write a function that gets two numbers (as parameters) and returns their sum. Write a program that uses the above function to find the sum of the elements in an array contains 10 numbers.
Program is in C++. Write a function named wordStatsPlus that accepts as its parameter a string holding a file name, opens that file and reads its contents as a sequence of words, and produces a particular group of statistics about the input. You should report: the total number of lines; total number of words; the number of unique letters used from A-Z, case-insensitively, and its percentage of the 26-letter alphabet; the average number of words per line (as an un-rounded...
Program is in C++. Write a function named wordStatsPlus that accepts as its parameter a string holding a file name, opens that file and reads its contents as a sequence of words, and produces a particular group of statistics about the input. You should report: the total number of lines; total number of words; the number of unique letters used from A-Z, case-insensitively, and its percentage of the 26-letter alphabet; the average number of words per line (as an un-rounded...
C++ programming language Write a program that contains following function: A function that receives a string of character, the function returns the number of letter c's or C's in the string the function receives
Write a python function score_formatter() that takes one parameter, which is a formatted string that contains information about the score received by a student in a particular subject. The function analyzes the string and returns a reformatted string for the score. You will need to use the function re.sub that is discussed in the lecture notes. If the string does not match the pattern, the function returns the string "error". The input string is always given in the format specified...
4. Write a C function int str2int(char *s) that takes string s as parameter and return the integer that s represents. For example, if string s is 123", then the function return integer 123.