Here, we have a basic program example to display the name and sequential year of birth using different languages. This program is created in c language, c++, Java, and Python.
Program to print the name and sequential birth year in C language
#include <stdio.h>
int main()
{
char first_name[20], last_name[20];
int birth_year;
printf("Input your First Name: ");
scanf("%s", first_name);
printf("Input your Last Name: ");
scanf("%s", last_name);
printf("Input your year of birth: ");
scanf("%d", &birth_year);
printf("%s %s %d\n", first_name, last_name, birth_year);
return 0;
}
Program to print the name and sequential birth year in C++ language
#include<iostream>
using namespace std;
int main(){
char first_name[20], last_name[20];
int birth_year;
cout<<"Enter your First Name: ";
cin>>first_name;
cout<<"Enter your second Name: ";
cin>>last_name;
cout<<"Enter your year of birth: ";
cin>>birth_year;
cout<<first_name<<"\t"<<last_name<<"\t"<<birth_year;
return 0;
}
Program to print the name and sequential birth year in Python language
first_name=input("Enter Your First Name: ")
last_name=input("Enter Your Last Name: ")
birth_year=int(input("Enter your year of birth: "))
print(first_name,"",last_name,"",birth_year)
Program to print the name and sequential birth year in Java language
import java.util.*;
class info
{
public static void main(String[] args)
{
Scanner s=new Scanner(System.in);
System.out.println("Enter your First Name :");
String first_name=s.nextLine();
System.out.println("Enter your Last Name :");
String last_name=s.nextLine();
System.out.println("Enter your year of birth :");
String birth_year=s.nextLine();
System.out.println(first_name + " " + last_name + " " + birth_year);
}
}