Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void sum_digit;
- static int sum;
- static int letters;
- int main(void){
- sum = 0;
- letters = 0;
- //get string from user
- //call functions
- sum_digit(char[] str, 0)
- printf("Sum of numbers = %d \n Number of letters = %d.", sum, letters);
- return 0;
- }
- void sum_digit(int pos,str){
- //check if pos is at the end of the string
- //checks if the element is a number
- if(isdigit(str[pos])){
- sum += str[pos];
- pos++;
- }
- }
- void count_alph(int pos, char[] str){
- //check if pos is at the end of the string
- //Check if the element is not a number
- if(!isdigit(str[pos])){
- letters++;
- pos++;
- }
- sum_digit()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement