aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Model 204 Programming Fundamentals
  • BEGIN %X IS FIXED DP 0 %X = 1.95 PRINT %X END What will b...
Multiple choice technology programming languages

BEGIN %X IS FIXED DP 0 %X = 1.95 PRINT %X END What will be the value of %X

  1. 1.95

  2. 2

  3. 1

  4. 0

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The declaration FIXED DP 0 means fixed decimal with 0 decimal places. When 1.95 is assigned to %X with 0 decimal places, it is truncated (not rounded) to 1. The value printed will be 1, not 1.95 or 2.

Keep practicing — related questions

  • For the given program what is the value of X ? BEGIN %X IS FIXED DP 0 %X = 1.9 PRINT ’%X = ’ WITH %X END
  • int x = 0; for (x=1; x<4; x++); printf(x=%dn, x); What will be the output of the sample code given above?
  • What will be printed as the result of the operation below: main() { int x=5; printf(“%d,%d,%dn”,x,x< <2,x>>...
  • What will be printed as the result of the operation below: main() { int x=10, y=15; x = x++; y = ++y; print...
  • What will be printed as the result of the operation below: main() { int x=20,y=35; x=y++ + x++; y= ++y + ++...
  • Determine output: void main(){ int x,y; x = 5; y = ++x * ++x; printf("Value of x = %d and Value of y = %d\n...
  • int x = 0; for ( ; ; ) { if (x++ == 4) break; continue; } printf(x=%dn, x); What will be printed when the s...
  • main() { int x=10, y=15; x = x++; y = ++y; printf(“%d %dn”,x,y); }
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy