What will be the value of a and b, when n assumes the following values in the given code snippet?
i) 0
ii) 2
int a=5,b=5;
if(n>0)
{
a=a+1;
b=b+1
}
else
{
a=a-1;
b=b-1;
Share
What will be the value of a and b, when n assumes the following values in the given code snippet?
i) 0
ii) 2
int a=5,b=5;
if(n>0)
{
a=a+1;
b=b+1
}
else
{
a=a-1;
b=b-1;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
0 Replies