Program/Programme to display a biodata using printf in C
Program :
#include <stdio.h> #include <conio.h> int main() { char name[30],fname[30],dob[12]; char bg[5],aadhar[12],address[50]; printf(" Enter name: "); scanf("%[^\n]%*c", name); printf("\n Enter father's name: "); scanf("%[^\n]%*c", fname); printf("\n Enter Date of birth: "); scanf("%[^\n]%*c", dob); printf("\n Enter blood group: "); scanf("%[^\n]%*c", bg); printf("\n Enter Aadhar Number: "); scanf("%[^\n]%*c", aadhar); printf("\n Enter address: "); scanf("%[^\n]%*c", address); printf("\n\n\t--your Biodata--\n"); printf("\nName: "); printf("%s", name); printf("\nFather's Name: "); printf("%s", fname); printf("\nDate Of Birth: "); printf("%s", dob); printf("\nBlood Group: "); printf("%s", bg); printf("\nAadhar Number: "); printf("%s", aadhar); printf("\nAddress: "); printf("%s", address); return 0; }
Output:
Enter name: Karan Kumar
Enter father's name: Avdhesh Kumar
Enter Date of birth(dd/mm/yy): 12/12/1995
Enter blood group: AB
Enter Aadhar Number: 123456789012
Enter address: Varanasi UP
--your Biodata--
Name: Karan Kumar
Father's Name: Avdhesh Kumar
Date Of Birth: 12/12/1995
Blood Group: AB
Aadhar Number: 123456789012
Address: Varanasi UP
this program not working
ReplyDeleteIt's working now, just a semicolon was missing. Thanks for your feedback
Delete