c programming

Project Description:

i need help correcting this program

create a program that performs the following functions: uses character arrays to read a user’s name from standard input, tells the user how many characters are in his or her name, and displays the user’s name in uppercase.
(1) have the user enter a name, and store the name in character arrays. why multiple arrays? make the assumption that the name has a first name and a last name, keep each name in two character arrays. you will have to declare the arrays, then ask the user for the two names and store them in the two arrays.
(2) count how many characters are in the name. which means that you have to count the characters in the two arrays, add them and display the total count. if the user entered "john" and "smith", the answer would be 9.
(3) display the user name in upper case. you need to display the first and last name back to the user, but in upper case. how do you change the characters to upper case? with a function. you can search chapter 8 for the function to use.
#include _stdio.h_
#include _string.h_
main ( )
char firstname [ ]= {‘’};
char lastname [ ] = {‘’};
printf (“enter your first name”);
scanf (“%s”, firstname);
printf(“nyou entered :%s, firstname”);
printf (“enter your last name”);
scanf (“%s”, lastname);
printf(“nyou entered: %s, lastname”);
} //end main

strlen gives the string and give the length in numeric
#include _stdio.h_
#include _string.h_
main ( )
char *str 1 = “victor”;
char str 2 = [ ] = “salmeron”;
printf (“nthe length of string 1 is %dn”,strlen(str1));
printf (“the length of string 2 is %dn”,strlen (str2));
}// end main

tolower and toupper, uppercase

#include _stdio.h_
#include _ctype.h_
// function prototypes
void convertu (char *);
main ( )
char name1[ ] = “victor”;
char name2 [ ] = “salmeron”;
} // end main
void convertu (char * str)
int x;
for (x=0; x_=strlen (str); x++)
str [x] = toupper (str [x] );
printf (“nlast name converted to uppercase is %sn”,str);
}// end convertu
Skills Required:
Project Stats:

Price Type: Negotiable

Total Proposals: 2
1 Current viewersl
83 Total views
Project posted by:


Proposals Reputation Price offered
  • 4.8
    30 Jobs 27 Reviews
    $0 in 0 Day
  • 1.0
    1 Jobs 1 Reviews
    $10 in 0 Day