Write a Program to display Name, age and salary of a person in C Programming

Have a look and try it Yourself!!

 

#include <stdio.h>

int main(){
char name[20];
int age;
float salary;
printf("Enter your name: ");
gets(name);
printf("Enter your age: ");
scanf("%d",&age);
printf("Enter your salary: ");
scanf("%f",&salary);
printf("Name: " );
puts(name);
printf("\n Age: %d",age);
printf("\n Salary:  %.2f",salary);
}

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.