Ace Learns Logo Ace Learns
  • Home
  • History
  • Geography
  • Astronomy
  • Physics
  • Chemistry
  • Biology
  • Agriculture
  • Sports
  • Computer Science
  • Articles
  • Contact Us
MCQ Categories
  • Articles
  • Home
  • Contact Us
  • Home
  • »
  • Computer Science
  • »
  • Programming in C
  • »
  • Data Types in C
  • »
  • What would be the value of ‘a’ after execution of the following code?

Programming in C

unfold_more
  • double_arrow Data Types in C
  • double_arrow Operators in C

What would be the value of ‘a’ after execution of the following code?

In C, arithmetic operations involving a char and an int, the char is implicitly converted to an int according to the ASCII value of the character.

The ASCII value of the character ‘x’ is 120. Therefore, when adding 5 and ‘x’, the value of ‘x’ (120) is added to 5.

So, after the execution of int a, b = 5;

char c = ‘x’;

a = b + c;

the value of a would be:

a = 5 + 120
a = 125

Related Questions

  • What is the size of the char data type in C?
  • Which data type does not occupy any memory space?
  • Which data type is used to store true/false values in C?
  • What is the purpose of the void data type in C?
  • In C, which data type is used to store memory addresses?

Quick Links

  • Computer Science
    • chevron_right Computer Organization
    • chevron_right Cloud Computing
    • chevron_right Python Programming Language
    • chevron_right Operating System
  • Sports
    • chevron_right Football
    • chevron_right Asian Games
    • chevron_right Cricket
    • chevron_right Common Wealth Games
  • Chemistry
    • chevron_right Matter and Measurements
    • chevron_right Chemical Bonding
    • chevron_right States of Matter and Solutions
    • chevron_right Acids Bases and Salts
  • Physics
    • chevron_right Geometrical Optics
    • chevron_right Thermodynamics
    • chevron_right Dynamics
    • chevron_right Electricity and Magnetism

Ace Learns Logo Ace Learns © 2025 Ace Learns. All rights reserved.
  • Contact Us
  • Copyright
  • Privacy Policy