Q6: Can you name a suitable bit wise operator for checking whether a certain bit is on or off ? The bitwise AND operator. Let’s have a look at the following example: enum {KBit0 = 1, KBit1,…KBit31,}; if ( some_int & KBit24 ) prin tf ( “Bit number 24 is ON\n” );els...
It’s another example of commonly asked ruby interview questions. Although seemingly equivalent at first glance, their evaluation may surprise you. If you print them, you’ll get number1 to be true and number2 as false. This happens because = (assign operator) has higher precedence in Ruby t...
bitwise operators: ~ & ^ | « » the pass instruction simple strings: constructing, assigning, indexing, slicing comparing, immutability accuracy of floating-point numbers expanding loops: while-else, for-else, nesting loops and conditional statements ...
1. How are many sequences of statements present in c++? a) 4 b) 3 c) 5 d) 6 View Answer 2. The if..else statement can be replaced by which operator? a) Bitwise operator b) Conditional operator c) Multiplicative operator d) Addition operator ...
bitwise operators: ~ & ^ | « » expanding loops: while-else, for-else, nesting loops, and conditional statements formatting print() output with end= and sep= arguments Boolean operators: not and or 2. Data Aggregates (25%) Objectives covered by this section: ...
What is pointer to pointer in C? What is stream in C? How will you swap 2 variables without using temp variable in C? What is operator precedence in C? What is the size of int, char, float and double data types in C? What is truncation in C? When does it happen?
Bitwise operator Arithmetic operator Bitwise Assignment operator None of theseAnswer: C) Bitwise Assignment operatorExplanation:The bitwise AND assignment operator (&=) uses the binary representation of both operands, does a bitwise AND operation on them and assigns the result to the variable....
Write a C program to count number of set bits in an integer. Write a C program to check if a positive integer is palindrome or not. Write a C program to swap two numbers using bitwise XOR operator and without using third temp variable. ...
30. What is the sizeof(char) in a 32-bit C compiler? a) 1 bit b) 2 bits c) 1 Byte d) 2 Bytes View Answer 31. Which of the following is not an operator in C? a) , b) sizeof() c) ~ d) None of the mentioned
To convert, e.g., the number 144 to the string '144', use the built-in function str(). If you want a hexadecimal or octal representation, use the built-in functions hex() or oct(). For fancy formatting, use the % operator on strings, e.g. "%04d" % 144 yields '0144' and "...