Home Forums C Programming please help me in this… Reply To: please help me in this…

#3452
Humayan
Participant

Is this what you need? :
 

/****************************************************************
* File Name : c:programshelpnames.cpp
* Date : September,9,2008
* Comments : new project
* Compiler/Assembler :
* Program Shell Generated At: 3:55:05 p.m.
=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

#include < stdio.h >
#include < string.h >
//#include < conio.h >
//#include < math.h >
//#include < iomanip >
//#include < ctype.h >
#define MAX_NAME_LENGTH 30
//using namespace std;
 //main function ******************************
int main ( )
{
    char firstName  [ MAX_NAME_LENGTH ];
    char middleName [ MAX_NAME_LENGTH ];
    char lastName   [ MAX_NAME_LENGTH ];
   
 printf ( "Enter a full name " );
    scanf ( "%s" , firstName );
    scanf ( "%s" , middleName);
    scanf ( "%s" , lastName );
    printf ( "output: " );
    printf ( "%c" , firstName [ 0 ] );
    printf ( " " );
    printf ( "%c" , middleName [ 0 ] );
    printf ( " " );
    printf ( "%s" , lastName );
    printf ( "n" );
    return 0 ;
}