Quantcast
Channel: Need help with a first name last name program - Stack Overflow
Browsing all 6 articles
Browse latest View live

Answer by gether roe for Need help with a first name last name program

#include<iostream> using namespace std; int main(){ //variables for the names char first[31], last[31]; //prompt user for input cout<< "Give me your name (first then last) and I will...

View Article



Answer by Konstantin Spirin for Need help with a first name last name program

name.Split('').Reverse().Aggregate((acc, c) => acc +", "+ c);

View Article

Answer by Cory Charlton for Need help with a first name last name program

string fullName = "John Doe"; string[] nameParts = fullName.Split(''); string firstName = nameParts[0]; string lastName = string.Empty; if (nameParts.Length == 2) { lastName = nameParts[1]; } else {...

View Article

Answer by Michael Petrotta for Need help with a first name last name program

Here's the approach I would take.Find the index of the space in the name.Extract the first name, by extracting all characters from the beginning of the string to just before the space you found.Extract...

View Article

Answer by Adriaan Stander for Need help with a first name last name program

Try using the String.Split Method for string, with the required seperator.Once you have the string array, you can use these to format a return value. (see String.Format Method (String, Object[])Please...

View Article


Need help with a first name last name program

I need help to create a program that allows the user to input their firstname and lastname separated by a space. I then need to display this information in reverse for example.Input:John...

View Article
Browsing all 6 articles
Browse latest View live


Latest Images