c examples | EDUshark

               






Prg 1. Input int type value from user */



Explanation: The scanf function is used to take input from keyboard.

Prg 2. Input more than one int type value ver 1*/



Explanation: There is nothing new in this program except that we have taken two integer values one by one for x and y respectively. The next program shows how to take two integer values with a single scanf.

 


Prg 3. Reading mix data types */

Explanation: The program is simple and easy to understand.


Prg 4. Printing ascii value of char input */

Explanation: The program is self-explanatory.

Prg 5. Demo of enumeration constants ver 1*/



 Explanation: The program is self-explanatory.The enumeration constants are basically used in switch-case construct.





"There is a Ques where you need to decide about its question tag.."

Operators and Expressions


  

Explanation: As started earlier car can also be used as enumeration constants. In fact char constants are internally treated as integer due to their ASCII (American Standard Code for Information Interchange) values. In the program we have shown both ASCII values and char representation of enumeration constants. The symbols PLUS,MINUS etc can be used in if and switch-case construct for comparision purpose.  



Comments