write a program to accept 2 numbers from user calculate sum
of each digit,reverse the orignal number and display

Answer Posted / amol

Void main()
{
Int x,y
Cout<<”enter two nos”
Cin>>x>>y;
Cout<<”Menu”<<endl;
Cout<<” 1. Addition 2. Subtraction 3. Multiplication 4.
Swapping the values 5. Reverse order”;
Cin>>c;
Switch(c)
{
Case 1: sum=x+y
Cout<<sum;
Case 2: sub=x-y;
Cout<<sub;
Case 3: pro=x*y;
Cout<<pro;
Case 4:swap=x;
x=y;
y=swap;
cout<<x<<y;
case 5: while(x/10!=0)
{
n++;
}
For(i=1;i<=n;i++)
{
Cout<<”reversed x=”;
r=x%10;
Cout<<r
x=x/10;
}
while(y/10!=0)
{
n++;
}
For(i=1;i<=n;i++)
{
Cout<<”reversed y=”;
r=y%10;
Cout<<r
y=y/10;
}
Default: break;
}
Getch();
}

Is This Answer Correct ?    8 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the efficient way or solutions to avoid ABEND=S04C.

6007


Please tell us about an implementation that you worked on that did not go as planned. What were the challenges you faced and how did you overcome them

1551


please send aptitude test papers for reference with answers

1274


could u please tell me where the click view tool coaching in hyderabad

1419


how bluetooth works?what is principle behind in it?

5707






How to score well in examination of MCA(engg) december 2012? please reply soon........

1412


how u test the idoc in inbound and outbound?

1586


when air is supplied from larger diameter pipe with some pressure if change diameter to small pipe the pressure increases or not? also what is increased pressureor velocity?

1361


What would be your first invention?

745


No. of rounds: 1. GD 2. Written test 3. Technical round 4. HR Group Discussion: In GD I got topic “Effect of Movies on Youth, is it good or bad?”. Everyone got chance to speak. They examined the fluency and point of view on topic. I was selected in this round. Written Test: In written, there were 30 to 40 question including 5 subjective, they are, 1 What is RTTI(Run Time Type Information)? 2 What is containership? 3 What is the difference between compiler level of C++, C# and one other language? 4 Why C++ reserve 2 bytes for structure? 5 One question was related to dot net….. Remaining question are objective and they are belongs to C, Data Structure, 4-5 question from Java and also some questions from Software Development, includes, Some programs given with there output, questions related to sorting algorithm and there complexities, from java, multithreading and a program for Concatenation of two strings using inbuilt methods, from Software development they ask about software lifecycle(including all phases), specification and testing. It was all technical and I cleared the written too. Technical round: In this round, they asked about my resume. Remember the things that you write only those things in resume, in which you are very well, else it will create problems for you. They asked first about myself, and then about my programming skills. They give me a problem to solve in C. They ask me about SQL commands (because I mentioned in resume) like difference between delete and truncate, left join with syntax, then some questions from OS and computer network. I also found out that they were taking my stress testing. They fired questions very rapidly. Don’t give up they will make you feel free environment if you will get nervous (at that time I was). HR round: In this round as usual they asked about personal question to starting with about yourself. They asked some IQ questions like which object with four points are at equidistance, draw three co-centric circle without pull-up your hand, they also asked question, if a bear is jump from 1 meter in …sec. what is the color of that bear. Answer is related to measuring gravity according to south and north pole, and I was confused at that time. They also asked the meaning of my name, I gave that answer.

2274


#include int fn(int v); main() { printf("%d\n",fn(7)); } int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; }

1529


Hello, I need to compare, using a cobol program, two cobol skeletons. I don't know if it is easy to do this or it will be so complicated. I wanna have your opinions. Thanks a lot

1488


My gre score is 283 and ielts is 5.5, will i get i20 for this score

1060


hi friends i am b-tech in computer science having interview of State bank of india clerk day on 30 th april. I want to know the answer of question:"you r B.tech in C.S. why do u want to become a bank clerk?" please help.Its my humble request.

1579


how many protocols are available and what are they?

1881