/*
This program written to accept input from the user
and print it back on the console.
*/
#include <stdio.h>
int main()
{
// integer values
int a;
printf("Enter a number: "); // ask user to enter a number
scanf("%d", &a); // read the user entered value
/* if the user enters a value other than a number,
output will be unpredictabe. */
printf("You have entered: %d.\n\n", a); // print it back on the console.
// floating point values
float b;
printf("Enter a floating point number: "); // ask user to enter a floating point number
scanf("%f", &b); // read the user entered value
/* if the user enters a value other than a number,
output will be unpredictabe. */
printf("You have entered: %f.\n", b); // print it back on the console.
printf("After considering only two decimal points: %.2f.\n\n", b); // print it back on the console using a CONTROL STRING.
// char values
int c[10];
printf("Enter a string: "); // ask user to enter some text
scanf("%s", &c); // read the user entered text
/* Character array will read anything from user.
So, the output will be same as entered by the user. */
printf("You have entered: %s.\n\n", c); // print it back on the console.
return 0;
}