What will the following program print, char type as int type - C Language Basics

C examples for Language Basics:printf

Description

What will the following program print, char type as int type

Demo Code

#include <stdio.h> 
int main(void) 
{ 
     char c1, c2; 
     int diff; //from  w w w  .j a  v a  2s  .  com
     float num; 
 
     c1 = 'S'; 
     c2 = 'O'; 
     diff = c1 - c2; 
     num = diff; 
     printf("%c%c%c:%d %3.2f\n", c1, c2, c1, diff, num); 
     return 0; 
}

Related Tutorials