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

when there is a parametrized constructor, and an object is created with no arguments. will the default constructor be called?

0 Answers  


how am i supposed to convert a class program in C++ to Matlab? Do i also need to make classes in matlab too or I can do it without making classes???Can somebody help....

0 Answers  


Why DG Set manufacturers do not give options for alternative fuels. They even do not allow to change at the cost of custmers.

0 Answers  


is the meter head is same as back pressure?

0 Answers   GDex,


Explain work?

0 Answers  


can anybody send me the technical papers of hewitt associates pls...I cleared aps n GD n has only less time for technical round?

0 Answers   Hewitt,


when will the group1&group2 exams will be held

0 Answers  


What is the distance between earthing pit and equipment?

1 Answers   Construction,


what is locative information on web.........?

0 Answers  


I attended an interview with CGI last week for network engineer and here are the questions that might help you guys who are going to attend interviews.

1 Answers   CGI,


i want a richdatatable to be displayed only when a list has some value in the bean, and a datatable with header only if the list is empty. And i want the datatable to be printed only when ajax button is clicked??

0 Answers  


what the bridge id of any switches

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16637)
  • 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)