What happens when you attempt to compile and run the following code?
#include
using namespace std;
int fun(int x) {
return x<<2;
}
int main(){
int i;
i = fun(1) / 2;
cout << i;
return 0;
}
How many times will "HELLO" be printed?
#include
using namespace std;
int main()
{
for(int i=?1; i<=10; i++)
{
if(i < 5)
continue;
else
break;
cout<<"HELLO";
}
return 0;
}
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
const int x=20;
const int *ptr;
ptr = &x;
*ptr = 10;
cout<<*ptr;
return 0;
}