C Language Tutorials by Ghulam Murtaza Dahar - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Output

Enter value: 23.45

Value=23.450000

Conversion format string "%f" is used for floats to take input and to display floating value of a variable.

I/O of characters and ASCII code

#include <stdio.h>

int main(){

char var1;

printf("Enter character: ");

scanf("%c",&var1);

printf("You entered %c.",var1);

return 0;

}