Anonymous
There are a lot of tutorials on Visual Studio, but I don't think CodeBlocks has them
Nikita
And the biggest part of em stay in shadow
Nikita
It relatives to beggs of course
I_Interface
Ok what should i use?
Which OS do u use?
I_Interface
W10
Lol, visual studio ofc
Anonymous
I_Interface
I m begginer
what's ur problem to go for youtube and learn how to use it for begginer ?????
joel
Ok,what should i use
use it there's nothing wrong with it
Anonymous
I meaned thath being a beginener i need a compiler for beginner
I_Interface
Anonymous
Ok tanks all
joel
just use code blocks don't stress yourself
joel
you're already use to it no need for change
Dima
What the fuck, do you even read the rules?
Dima
I see a lot of a screen photos
Dima
come on
Dima
Nikita
What's the problem with codeblocks?
Anonymous
itsmanjeet
how to rotate this in qtcreator
Dima
Nikita
Gaats,it's you first proj?
itsmanjeet
new with qtcreator
Dima
how to rotate this in qtcreator
your bio is the answer lol!
itsmanjeet
i tried but google show result for codes . not gui of designer
Anonymous
Guys,Someone Here Use Atom For C++?
I_Interface
Atom, CodeBlocks... what the **** ?
Dima
use vim :>
:> <-> :q
Ariana
type Cltr+S to freeze terminal
Dima
stop right here, freeze!
Anonymous
using namespace std; class gfg { /* Function to calculate x raised to the power y */ public: int power(int x, unsigned int y) { if (y == 0) return 1; else if (y % 2 == 0) return power(x, y / 2) * power(x, y / 2); else return x * power(x, y / 2) * power(x, y / 2); } };
Anonymous
anyone please make it using loops
Mat
We can help you, but we'll not do your work
Anonymous
No
i have made it
Anonymous
but need more optimized then this
Anonymous
int pow(int a,int b) { int k=0; int arr[10]; while(b>1) { if(b%2==0) { a=a*a; b=b/2; } else if(b%2!=0) { arr[k]=a; a=a*a; b=(b-1)/2; k++; } } if(k>0) for(int i=0;i<k;i++) { a=a*arr[i]; } return a; } int main() { printf("%d",pow(2,27)); }
Anonymous
yes
Anonymous
but optimised way
Mat
How would you calculate 2^3?
Mat
but optimised way
Oh, okay 🤔
I_Interface
2*2*2
use std::pow
Mat
but optimised way
Has it more optimization than a simple for loop to multiply a b times?
Anonymous
use std::pow
i know but i want to create it
Jussi
1 << 2;
Most optimized way to calculate powers of 2
Anonymous
2^8=2^4+2^4
I_Interface
Most optimized way to calculate powers of 2
hah, bite shift, are u sure what he can do this ?)
Jussi
2^8=2^4+2^4
Or just 1 << 7
Anonymous
hmm right
Anonymous
Or just 1 << 7
what about 9^9?
Jussi
That cannot be done by bit shifting
I_Interface
I_Interface
what about 9^9?
what do u know about bit and bit operations?
Anonymous
thats why asked
Anonymous
i need more optimized than this
Jussi
I dunno how % is implemented internally
Jussi
Most likely it is optimized already
Anonymous
hmm but the arr[10] i used takes more space
Anonymous
i need to to optimize it
Jussi
But you can do (b>>1)&1 . if it returns 1, it is same as b%2==0
Anonymous
because if the space is not used it takes space of 10 integers
Anonymous
to reduce space complexity
Jussi
Ehh