Reference no: EM132494185
In a 'c' file called powers.c, create the function to calculate powers of 2.
Your function should take no parameters. Each time it is called, the function should return the next power of two in sequence.
Called once, your function should return 2.
Called a second time, your function should return 4, then 8, then 16, then 32, etc.
Note: Use local variables only, ot global variables. Once your function is finished, write the main() function to test it.
Note: Due to an integer only being 32 bits, if this function is called more than 31 times than an integer overflow will occur and the result will be invalid