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

  • Which of the following data types is used to store single-precision floating-point numbers 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?
  • What is the size of the char data type in C?
  • Which data type is used to store true/false values in C?

Quick Links

  • Computer Science
    • chevron_right Computer Organization
    • chevron_right Cloud Computing
    • chevron_right Databases
    • chevron_right Language Processors
  • Biology
    • chevron_right Human Diseases
    • chevron_right The Human Body System
    • chevron_right Plants
    • chevron_right Genetics
  • Current Affairs & Events
    • chevron_right Daily Current Affairs
    • chevron_right Latest Current Events
  • Sports
    • chevron_right Cricket
    • chevron_right Common Wealth Games
    • chevron_right Olympics
    • chevron_right Football

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