27.4k views
4 votes
Write a program to display your name, age and address in c programming​

User Maroodb
by
5.0k points

1 Answer

3 votes

Answer:

The program in C is as follows:

#include <stdio.h>

int main(){

char name[] = "Mr. Royal";

int age = 20;

char address[] = "Lagos, Nigeria";

printf("Your name is %s.\\", name);

printf("You are %d years old\\", age);

printf("Your address is %s.", address);

return 0;

}

Step-by-step explanation:

This initializes the name

char name[] = "Mr. Royal";

This initializes the age

int age = 20;

This initializes the address

char address[] = "Lagos, Nigeria";

This prints the name

printf("Your name is %s.\\", name);

This prints the age

printf("You are %d years old\\", age);

This prints the address

printf("Your address is %s.", address);

Change the necessary details to yours

User Borys Kupar
by
5.4k points