Write a function that takes the first name and last name of a student and returns his/her full name. Write main to test the function.
Sample Input / output:
Enter your first name : Andre
Enter your last name : Wolf
Your full name is Andre Wolf.
I know that if I have that, I would use a prinft() statement and then use a scanf() statement to complete the whole code but I guess it wasn't right. Any tips?
1
Expert's answer
2012-12-07T04:05:28-0500
#include <iostream> using namespace std;
char fname[100], lname[100];
void main(){ cout<<"Enter your first name : "; cin>>fname; cout<<"Enter your last name : "; cin>>lname; cout<<"Your full name is "<<fname<<" "<<lname<<".\n"; system("pause"); }
Comments
Leave a comment