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

write a program to display & create a rational number

1 Answers   HCL, TCS,


What is structure data type in c?

0 Answers  


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

0 Answers  


How can I do peek and poke in c?

0 Answers  


What is a string?

0 Answers  






What is variable and explain rules to declare variable in c?

0 Answers  


Is main is user defined function?

0 Answers  


What do you mean by command line argument?

0 Answers   TCS,


What is the best way to store flag values in a program?

0 Answers  


What is the right way to use errno?

0 Answers  


What is a method in c?

0 Answers  


What's the best way to declare and define global variables?

7 Answers  


Categories