प्रश्न और उत्तर का अभ्यास करें

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

*( ( a <= 20 ) ? &b : &c ) = 30;

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

The order may vary from compiler to compiler. Here the multiplication will happen before the addition , but in which order the functions would be called is undefined. In an arithmetic expression the parentheses tell the compiler which operands go with which operators but do not force the compiler to evaluate everything within the parentheses first.

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

-2  3  0  1

प्र: We want to round off x, a Float to an Int value. The correct way to do so would be 15806 0

  • 1
    Y = ( int ) ( x + 0.5 ) ;
    सही
    गलत
  • 2
    Y = int ( x + 0.5) ;
    सही
    गलत
  • 3
    Y = ( int ) x + 0.5;
    सही
    गलत
  • 4
    Y = ( int ) ( ( int ) x + 0.5 )
    सही
    गलत
  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर : 1. "Y = ( int ) ( x + 0.5 ) ;"
व्याख्या :

Answer: A) Y = ( int ) ( x + 0.5 ) ; Explanation: Rounding off a value means replacing it by a nearest value that is approximately equal or smaller or greater to the given number.   y = (int)(x + 0.5); here x is any float value. To roundoff, we have to typecast the value of x by using (int)   Example:   #include   int main ()   {     float x = 2.6;     int y = (int)(x + 0.5);     printf ("Result = %d\n", y );     return 0;   }   Result : 3

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

Floating point formats not linked

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

4  8  10

  • उत्तर देखेंउत्तर छिपाएं
  • Workspace

उत्तर :
व्याख्या :

C++

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई

      त्रुटि की रिपोर्ट करें

    कृपया संदेश दर्ज करें
    त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई