Start New Discussion within our Software Development Community

ok, below is the code that i have tried and still not working;

#include <stdio.h>
int main ()
{
    char Name; 
    int Age;
    int Date_Of_Birth;  
    float Place_Of_Birth; 
    float Email_Address;
     printf ("Name:");
     scanf ("%c",&Name);
     printf ("Age:\n");
     scanf ("%d",&Age);
     printf ("Date Of Birth:\n");
     scanf ("%d",&Date_Of_Birth);
     printf ("Place Of Birth:\n");
     scanf ("%s",&Place_Of_Birth);
     printf ("Email Address:");
     scanf ("%s",&Email_Address);
return 0;
} 

Did i wrote the wrong code?

Are these supposed to be floats?

float Place_Of_Birth;
float Email_Address;

It makes more sense to have it as

char Place_Of_Birth[45];
char Email_Address[45];

Your scanf is incorrect here

scanf ("%c",&Name);

You need to scan for a c-string

scanf ("%s",Name);

These lines are wrong..

scanf ("%s",&Place_Of_Birth);
scanf ("%s",&Email_Address);

should be

scanf ("%s",Place_Of_Birth);
scanf ("%s",Email_Address);

Ooops missed one.

char Name;

should be

char Name[45];

Your making some fundamental errors in your code, I would track down a good intro into the subject of C programming.

This question has already been answered. Start a new discussion instead.