Sunday

how to get value from user or console and print it on console?

how to get value from user or console and print it on console?

Scan and Print value of Variable

File Name: "file_name.c"

Code:


void main()
{
int a;
clrscr();
printf("enter a value of a:");
scanf("%d",&a); //scan the value of a from console
printf("value of a =%d",a);
}

Output:

 

No comments:

Post a Comment