Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged bitwise
0
votes
1
answer
1
PTCUL-03
In C language, bitwise operation can be applied to which of the following operands A. char B. int C. short, long D. All of these
In C language, bitwise operation can be applied to which of the following operandsA. char B. int C. short, long ...
rishu_darkshadow
320
views
rishu_darkshadow
asked
Nov 8, 2017
Programming in C
ptcul-2017
programming-in-c
bitwise
+
–
3
votes
1
answer
2
Bit-wise operation
#include <stdio.h> int main() { unsigned int m = 0; m |= 0xA38; printf("%x\n",m|(m-1)); printf("%x\n",( (m|(m-1)) + 1 ) & m ); } Find the output ?
#include <stdio.h int main() { unsigned int m = 0; m |= 0xA38; printf("%x\n",m|(m-1)); printf("%x\n",( (m|(m-1)) + 1 ) & m ); }Find the output ?
dd
501
views
dd
asked
Jun 27, 2017
Programming in C
programming-in-c
bitwise
+
–
0
votes
1
answer
3
C programming
int main() { int n = 3,i,count=0; for(i=0;i<1<<n;i++) { int p = i; while(p) { int k = p & -p; p = p - k; count++; } } } The value of count variable after execution of the above code? The value of count variable when $n = m$ ? [EDITED]
int main() { int n = 3,i,count=0; for(i=0;i<1<<n;i++) { int p = i; while(p) { int k = p & -p; p = p - k; count++; } } }The value of count variable after execution of the ...
dd
687
views
dd
asked
Apr 20, 2017
Programming in C
programming-in-c
bitwise
+
–
5
votes
4
answers
4
Time complexity and output
#include <stdio.h> #define N 3 int main() { int array[N] = {1,2,3}; int i,j; for ( i=1; i<(1<<N); i++) { for( j=0; j<N; j++) { if((1<<j)&i) { printf("%d", array[j]); } } printf("\n"); } return 0 ... $N = n \;\; , n \; \text{ is a positive integer }$ ? B. What is the output? C. What will be the complexity when $N$ is large.
#include <stdio.h #define N 3 int main() { int array[N] = {1,2,3}; int i,j; for ( i=1; i<(1<<N); i++) { for( j=0; j<N; j++) { if((1<<j)&i) { printf("%d", array[j]); } } p...
dd
1.8k
views
dd
asked
Dec 17, 2016
Programming in C
time-complexity
bitwise
programming-in-c
combinatory
summation
sub-set
binomial-theorem
+
–
1
votes
2
answers
5
Logical and airthmatic left shift.
I just read that the logical and airthmatical left shift are same while there is a difference in case of right shift. https://en.wikipedia.org/wiki/Bitwise_operation (under Logical shift) Can understand how are they same. Like What is arithmetic left ... other hand, the logical left shift by 1 pos would be 10010010 but both are not same. any example on that.
I just read that the logical and airthmatical left shift are same while there is a difference in case of right shift.https://en.wikipedia.org/wiki/Bitwise_operation (unde...
Tendua
1.6k
views
Tendua
asked
Dec 5, 2016
Digital Logic
co-and-architecture
digital-logic
bitwise
+
–
5
votes
4
answers
6
GATE Overflow | Programming | Test 1 | Question: 12
What will be returned by the following function foo when called as foo(10)? int foo(int n) { return n & n | 1; }
What will be returned by the following function foo when called as foo(10)?int foo(int n) { return n & n | 1; }
Arjun
1.3k
views
Arjun
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
numerical-answers
bitwise
+
–
0
votes
2
answers
7
c_programming
What will be the output of the program? #include<stdio.h> int main() { char c=48; int i, mask=01; for(i=1; i<=5; i++) { printf("%c", c|mask); mask = mask<<1; } return 0; } A. 12400 B. 12480 C. 12500 D. 12556
What will be the output of the program?#include<stdio.h>int main(){ char c=48; int i, mask=01; for(i=1; i<=5; i++) { printf("%c", c|mask); mask ...
Anil Khatri
1.8k
views
Anil Khatri
asked
Sep 8, 2016
Programming in C
bitwise
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register