karthik p b


{ City } mysore
< Country > india
* Profession * student
User No # 104423
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 3
Users Marked my Answers as Wrong # 3
Questions / { karthik p b }
Questions Answers Category Views Company eMail




Answers / { karthik p b }

Question { 3752 }

write a program that input four digit no and finds it is
palindrome or not


Answer

#include
#include

void main()
{
int n,rev=0,rem, temp,i;

printf(" Enter the 4 digit number :\n");
scanf("%d", &n);

temp = n;
for(i=1;i<=4;i++)
{
rem = n % 10;
n = n/10;
rev = rev * 10 + rem;
}

if(temp == rev)
printf(" Its a palindrome:\n");
else
printf(" Not a palindrome:\n");
getch();
}

Is This Answer Correct ?    1 Yes 0 No

Question { Wipro, 37156 }

#define CUBE(x) (x*x*x)
main()
{ int a,b=3;
a=cube(b++);
printf("%d %d",a,b);
}
What should be the value of a and b? My calc a=4 but syst
a=6 how pls tell me if you know it?


Answer

a will be 27 and b will be 6.

since the cube root of 3 is assigned to 'a' it will contain the value 27, and after this 'b' will gets incremented 3 times (x++ * x++ * x++) hence 'b' will become 6

so a = 27 b= 6

Is This Answer Correct ?    2 Yes 3 No