Георгий
I've read the rules and I agree with them
Георгий
I've read the rules and I agree with them
Mino
Why you're working on a site and not on Microsoft Visual Stodio?
Could you send me the link for download the MVS?
ברני
Mino \//////////// Download Visual Studio 2019 for Windows & Mac https://visualstudio.microsoft.com/downloads/
Rama
Hello World!
Tostisto
Guey, how test bit on n position?
Tostisto
If is bit set to 1 or 0
数学の恋人
If is bit set to 1 or 0
Bit masking (Google it)
Tostisto
Bit masking (Google it)
#include <stdio.h> #include <stdlib.h> #include <stdint.h> uint8_t stuff() { uint8_t mask = 0x0f; // 00001111b uint8_t value = 0x55; // 01010101b return mask & value; } int main(void) { stuff(); return 0; }
Tostisto
Someone help me how do this?
Tostisto
Intput is Ip: 10.23.110 mask: 255. 255. 192.0 And output is my IP Please someone help me. Thanks
SHAISTA
// C++ program to find smallest number evenly divisible by // all numbers 1 to n #include<iostream> using namespace std; long long gcd(long long a,long long b) { if(b==0) return a; return gcd(b,a%b); } long long gcd4(long long x,long long y)//through this function i got wrong ans { for(long long j=1;j<=x && j<=y;j++) { if(x%j==0 && y%j==0) return j; } } long long gcd3(long long x,long long y)//through this function i got wrong ans { if(y>x) { long long temp=x; x=y; y=temp; } for(long long j=1;j<=y;j++) { if(x%j==0 && y%j==0) return j; } } long long gcd5(long long a,long long b) { if(a%b != 0) return gcd(b,a%b); else return b; } long long lcm(long long n) { long long ans=1; for(long long i=1;i<=n;i++ ) { ans=(ans*i)/gcd(ans,i); } return ans; } int main() { cout<<"enter number"<<endl; long long x; cin>>x; cout<<lcm(x); return 0; }
SHAISTA
I got wrong ans from two functions gcd3 and gcd4
SHAISTA
Please help where I m wrong
RC
Can anyone tell which is the best app for drawing and checking flowchart??
KGF
int main() { int a = 10; if (a == a--) printf("TRUE 1\t"); a = 10; if (a == --a) printf("TRUE 2\t"); }
KGF
Can anybody explain this
KGF
2 is the output
KGF
But how
!/usr
But in second case It first decrease the value of a then compares
Roshan
int main() { int a = 10; if (a == a--) printf("TRUE 1\t"); a = 10; if (a == --a) printf("TRUE 2\t"); }
--a is the prefix operator and a++ is the postfix. when you say cout<<a--; first the value of a will be printed then a is decremented by 1 i.e. a = a - 1; Whereas, if you write cout<<--a; then a is first decremented then it is printed.
Roshan
int main() { int a = 10; if (a == a--) printf("TRUE 1\t"); a = 10; if (a == --a) printf("TRUE 2\t"); }
Here in your program, you're checking if ( a == a--) printf("TRUE 1\t"); So is a == a ........ which is CORRECT After this a is decremented so the output is 1
Roshan
Get it?
olli
int main() { int a = 10; if (a == a--) printf("TRUE 1\t"); a = 10; if (a == --a) printf("TRUE 2\t"); }
it's UB, different compilers produce different results. Clang issues warning, (GCC does too on -Wall) <source>:5:19: warning: unsequenced modification and access to 'a' [-Wunsequenced] if (a == a--) ~ ^ <source>:8:18: warning: unsequenced modification and access to 'a' [-Wunsequenced] if (a == --a) ~ ^
olli
Well is it that the output will be different... I'm confused
ICC/GCC outputs TRUE 2 Clang outputs TRUE 1
olli
Lol how does Clang work?
the order the operands are evaluated in in different for clang
Roshan
Ok
Anonymous
Question: 2 Write a C code to search an item in a BST and check either it is prime, even, odd number or
Anonymous
plz help me
Anonymous
plz help me
Anonymous
plz help me
Anonymous
help me
Alex
plz help me
pls ban him
Георгий
plz help me
I've read the rules and I agree with them
Anonymous
okay its paper exam
Mino
Have to I download Visual studio 2019 or visual studio code ?
Crbala
Have to I download Visual studio 2019 or visual studio code ?
you can do it even with vi editor or code blocks or sublimetext
Crbala
it is not hard rule to use either vstudio or vscode
Crbala
yes there are static check addons are available indeed in vscode
Crbala
but the usability of these IDE and editor makes a suitable choice for some of engineers
Crbala
I know certain Product devlopment company who used VStudio to the core and they had to live with winmain to translate the calls from linux to windows based one
Crbala
since their entire product code was written with MFC
Crbala
as one of their core package
lukas
hi, can anyone recommend my a way to catch a negative value? for example if i want to calc with days and months, that 31.10 is lower than 1.11. or is there a better way to do this?
Mino
Do I have to*
Sorry, you have right. I'm working 😩
Mino
as one of their core package
Hence, Do u advice me to use Vscode ? If I will have problem, I'll change it with Vstudio.
Crbala
you cna use vscode
Mino
Because with c++ compiler I'm not able to plot the function. Because maybe, I don't have the library
Anik
what is interpreter
Anonymous
/resources
Anonymous
Ehm.. what was the command? ahha
fab
I read the rules, can I ask help with a school exercise? Just a suggestion?
Anonymous
I read the rules, can I ask help with a school exercise? Just a suggestion?
If you have tried it out and you got an error in it...
fab
If you have tried it out and you got an error in it...
I can do all exercise before but I don't understand what the exercise want
fab
write a program that displays the four possible combinations (truth table) obtained from two bool variables a and b with the statement a && b
fab
write a program that displays the four possible combinations (truth table) obtained from two bool variables a and b with the statement a && b
I don't understand what values ​​I should assign to a and b so that I can use the logical operator && as an example😅
Anonymous
I don't understand what values ​​I should assign to a and b so that I can use the logical operator && as an example😅
bool has only two values that is , either true or false , that can also be interpreted as 0 or 1
fab
Yes I know
Anonymous
Display 0,1
Anonymous
00,01,10,11
Roshan
Yes I know
01,10, 11, 00
fab
But I have to assign 1 and 0 to a and b ?
fab
Sorry for my bad English I'm italian
fab
Ok
Daniel
Good Morning
mov $22, %rax
Guys, do you have any knowledge about a good book on algorithms?
fab
Ok
I tried but it don't work 😂 can i post the code?