How to calculate sum

Answers were Sorted based on User's Feedback



How to calculate sum..

Answer / deepanshu dubey

#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int a,b,c;
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
c=a+b;
printf("%d\n",c);
}

Is This Answer Correct ?    8 Yes 2 No

How to calculate sum..

Answer / avinash jadhav

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int num1,num2,sum;
clrscr();
printf("\nEnter the 2 numbers\n");
scanf("%d%d",&a,&b);
sum=num1+num2;
printf("The sum of the two number is %d\n",sum);
getch();
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

What is structure padding in c?

0 Answers  


What are the data types present in c?

0 Answers  


Can you define which header file to include at compile time?

0 Answers   Aspire, Infogain,


What is a pointer in c?

0 Answers  


main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(“%d”,x); }

8 Answers   Vector,






write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

7 Answers   Calsoft,


write a statement to display all the elements array M(in reverse order? int M[8]={20,21,22,23,24,25,26,27};

5 Answers  


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

0 Answers   Amdocs, Apps Associates,


Why is structure important for a child?

0 Answers  


What is difference between function overloading and operator overloading?

0 Answers  


ASCII stands for

1 Answers  


Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80

0 Answers  


Categories