diff --git a/guide/english/c/variables/index.md b/guide/english/c/variables/index.md index d3d8cf9fe6..d1406dbccf 100644 --- a/guide/english/c/variables/index.md +++ b/guide/english/c/variables/index.md @@ -103,3 +103,32 @@ We get `15.300000`. So, say we just want two places after the decimal to give us * Variables are created in the following format: `datatype variable_name = number`. * Format specifiers allow for variables to be printed. * The equals sign `=` allows for values to be assigned to variables. + + + +## Program to show variables + +```C +#include + +int main() { + int i; + float f; + printf ("enter integer value\n"); + scanf ("%d", &i); + printf ("enter float value\n"); + scanf ("%f", &f); + printf ("integer value: %d \nfloat value: %f\n", i, f); + return 0; +} +``` + +#OUTPUT +```sh +enter integer value +1 +enter float value +2.2 +integer value: 1 +float value: 2.200000 +```