Create your identity card that includes the following details: - Name: ..... - Surname: ...... - Age: ...... - University: ...... University - Department: Computer Programming - ID Number: ......
Guys i have to do it same to that one but with the new subjects i need your helps. How can i do it ? with "C"
#include <stdio.h>
int main()
{
//declare variables
int id;
int age;
char name[16];
char class_name[4];
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
I found the second link to be the most help.
My first question is this a C or C++ program?
Next I see you have defined "class_name" as a 4 character array, so is the class name 3 or 4 characters? I it is 4 characters you will need to make it one larger for the terminating null (\0) that marks the end of the string.
Do you need a "name" and "surname" variables or will just one do?
Given the first line of your post I am thinking that you need the name in two parts.
The input part looks OK for now.
If the output is not what you want do it by hand and post what you want it to look like. You can use the output tag for this.
You are on the right path. You need to add a variable for the "surname" part then add to your "get information" section and then to the "printing out information given" section.
If you have any problems or questions post the revised code in a new message. DO NOT edit your original post with new code. this just confuses those who come in later.