Circuit Negma

C++, C, VB.NET, PCB, Electronics, Circuit Design

Exercise chapter 3.

Posted by Circuit Negma on February 6, 2006


/*
 *
 * Exercise chapter 3.
 *
 * by hussein, 2004
 * http://www.clipx.net/norton.php
 *
 * by hussein, 2004
 */
 
#include <stdio.h>

int main()
{
      char first[30];
      char last[30];
      char full[100];
      int name;
      
      printf("Please enter your first name: ");
      scanf("%s", first);
      printf("Please enter your last name: ");
      fflush(stdin);
      scanf("%s", last);
      
      strcpy(full,first);   //first need to initialize fuul by copying first name.
      strcat(full, " ");
      strcat(full,last);
      
      printf("Your name is >>> %s <<< \n", full);
      
      name = strlen(full) - 1;
      
      printf("The length of your name is >>> %d <<<\n", name);
      
      fflush(stdin);
      getchar();
     
      /*
       *
       * Exercise Chapter 3. question 2
       */
        
      
}


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: