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

Character of ASCII value 69: E

The ASCII value of 'A' is 65, 'B' is 66 and so on to 'Z' is 90. Similarly ASCII value of 'a' is 97, 'b' is 98 and so on to 'z' is 122.

More about Input/Output of floats and Integer

Variations in Output for integer an floats

Integer and floating-points can be displayed in different formats in C programming as:

#include<stdio.h>

int main(){

printf("Case 1:%6d\n",9876);

/* Prints the number right justified within 6 columns */

printf("Case 2:%3d\n",9876);

/* Prints the number to be right justified to 3 columns but, there are 4 digits so number

is not right justified */

printf("Case 3:%.2f\n",987.6543);

/* Prints the number rounded to two decimal places */

printf("Case 4:%.f\n",987.6543);

/* Prints the number rounded to 0 decimal place, i.e, rounded to integer */

printf("Case 5:%e\n",987.6543);

/* Prints the number in exponential notation(scientific notation) */

return 0;

}