write a program for input is 56 output will be 5+6=10?

Answers were Sorted based on User's Feedback



write a program for input is 56 output will be 5+6=10?..

Answer / mani kandan.s

#include<stdio.h>
#include<conio.h>
void main()
{
int n,a,b;
clrscr();
printf("Enter the n value");
scanf("%d",&n);
a=n%10;
b=n/10;
printf("Result is=%d",a+b);
getch();
}

Is This Answer Correct ?    14 Yes 3 No

write a program for input is 56 output will be 5+6=10?..

Answer / saranya

#include<stdio.h>
#include<conio.h>
main()
{
int n,a,b=0;
clrscr();
printf("Enter the n value");
scanf("%d",&n);
while(n!=0)
{
a=n%10;
b=b+a;
n=n/10;
}
printf("Result is %d",b);
getch();
}

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More Engineering AllOther Interview Questions

What is the filters function?

3 Answers  


what is the difference between load bearing and non load bearing walls

0 Answers  


can oracle driver be directly connected with odbc driver??

0 Answers  


Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.

0 Answers  


Q1 Design a webpage for a hotel which displays all the information of the hotel such as rooms available, facilities, and packages along with rate list. Apply the different tags available to give it a good style.

0 Answers  






What is the fallacy in the following program segment ? int *f1() { int a=5; return &a; } f() int *b=f1() int c=*b; }

1 Answers   Geometric Software,


what is a Additional domain ? what is a child domain?

0 Answers   Tesco,


draw diagram of earthings

0 Answers   IBM,


Given a set of numbers like 1,2,5,4,1,2,1,7 find the number of faults using LRU.

1 Answers   NetApp,


WHAT THE DIFFERENCE BETWEEN JCB 3DX & 3D?

7 Answers   HCC, L&T,


what is the formula/ ratio for hollow block? considering to a 40 kgs of portland cement.

0 Answers  


difference between w2k and win xp....

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)