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 purpose of the void data type in C?
  • In C, which data type is used to store memory addresses?
  • Which data type’s size is consistent in both 32-bit and 64-bit operating systems?
  • Which of the following data types is used to store single-precision floating-point numbers in C?
  • What is the size of the char data type in C?

Quick Links

  • Sports
    • chevron_right Football
    • chevron_right Asian Games
    • chevron_right Olympics
    • chevron_right Cricket
  • Physics
    • chevron_right Dynamics
    • chevron_right Thermodynamics
    • chevron_right Electricity and Magnetism
    • chevron_right Geometrical Optics
  • Astronomy
    • chevron_right Galaxies
    • chevron_right Stars
    • chevron_right Space Exploration
    • chevron_right Solar system
  • Geography
    • chevron_right Climatology
    • chevron_right Regional Geography
    • chevron_right Geopolitics and Global Issues
    • chevron_right Oceanography

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