Accept Element form user And Print it .
Accept elements from user
Accept elements from user and print it .
In this tutorial we learn how to accept element in C language.
The main statement is required scanf("",&);
The scanf statement is use for take input from user
The datatype of data is written in double quote.
The scanf statement is use for take input from user
The datatype of data is written in double quote.
- Character value %c
- Integer value %d
- Floating value %f
These three are the basic datatype .
#include<stdio.h>
void main()
{
int a;
printf("Enter one integer value :");
scanf("%d",&a);
printf("Entered integer is %d",a);
getch();
}
Step : 1
Open your turbo C compiler
Type the following program .
#include<stdio.h>
void main()
{
int a;
printf("Enter one integer value :");
scanf("%d",&a);
printf("Entered integer is %d",a);
getch();
}
Step : 2
Run it to pressing Ctrl + F9
Comments
Post a Comment