You are here:   HomeC Programming (Theory)Basic Of C Prog.Write a C program to read formatted data from stdin: how to use scanf.
by Dinesh Thakur Category: Basic Of C Programming



#include<conio .h>
void main()
char str[80];
int i;
printf("Enter your last name: ");
printf("Enter your age: ");
printf("Last Name = %s, age = %d .\n",str,i);
printf("Enter a hexadecimal number: ");
printf("You have entered %#x (%d).\n",i,i);

Enter your last name: Singh Enter your age: 24
Last Name = Singh, age = 24.
Enter a hexadecimal nurnber: 4012
You have entered 0*4012 (16402).

Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.

What's New and Popular

Popular Article