TutorialLab
c language variable examples
Home » Courses » C Language Variables Example Program

C Language Variables Example Program

C Language Variables Example Program

In this section of the course we have inserted some examples about integer variables, floating point variables.The example below are for the beginners and you can use turbo C or any other C language IDE to run the example.To run the example compile and run it.some of the programs require input from the user so don’t forget to provide input to the program and it will display the output. Result of every program is below the program code.

Integer Output Program

Output : number is 10

Here , we can go further and use a bit step up.

output 1 : enter a number

input : 10

Output 2: number=10

Detail about above Program: The scanf() functions is used to take input from user.In this program, the user is asked a input and value is stored in variable c.

Note the ‘&‘ sign before c. &c denotes the address of c and value is stored in that address and printf() shows the simply result.

Here we can also check input and output of character and float variables.

Floating Point Number Examples

Output : enter a number:

Input : 10.20

value=10.20

 

hassan

A Freelancer web developer, graphic designer and own this blog to spread knowledge.My hobby is computer problem's solving and i love to help other in this field.

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.