Programming C++

posted by .

#include<stdio.h>
#include<conio.H>
{
clrscr();
int first_value;
int second_value;

long result;
print f("enter your first value:);
scanf("%d",&first_value);
printf("enter your second value:);
scanf("%d",&second_value:);
result=first_value+second_value;
printf("the sum of two values is %d",result);
}

PROBLEM:
Let first value = 1600 second value = 1700
these values comes under the integer data their sum i.e. 3300 can't be accumulated under inter data type so long data type is used for the third variable that is result.
but the output is faulty, their is no solid for this behaviour please tell me any reason you can propose.
reply as soon as possible as i need it urgently.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. C programming

    Enter two integers between 1 to 10 3 4 Both numbers are less than 5. The sum of two numbers is:-1081825676 The product of two numbers is:-1081825680 why are the sum and product so weird?
  2. C Programming

    I am trying to find the sum of two integers. I entered the following program into the Visual Studio and it is telling me that there are errors. Can someone tell me where they are please?
  3. C programming

    Question: Write a program that reads integers from the keyboard until the user enters the sentinel value -999. The program should then print the minimum integer read, the maximum integer read and the average of all the integers. (Excluding …
  4. C programming

    A few questions, all involving "for" loops that I am unsure how to do (Thank you in advance for the help): Q1.) Write a table of conversions from Celsius to Rankin. Allow the user to enter the starting temperature and increment between …
  5. Computer

    on C++, I want to make an operation like " 2x + y - z ", I wrote something like that but I can' t get the result, where is my mistake?
  6. C Programming

    Write a C program that accepts sales made by 5 sales reps for the 4 months that they have been selling the company's products. The program should then find the total sales for 4 months, total sales for each sales rep, and total sales …
  7. Programming

    #include<stdio.h> int main() { char ch; printf("Enter Your State Name : "); scanf("%c",&ch); if(ch == 'a') printf("Shipping Charge : $25"); else if(ch == 'b') printf("Shipping Charge : $50"); else if(ch == 'c') printf("Shipping …
  8. Programming

    #include<stdio.h> int main() { char ch; printf("Enter Your State Name : "); scanf("%c",&ch); if(ch == 'a') printf("Shipping Charge : $25"); else if(ch == 'b') printf("Shipping Charge : $50"); else if(ch == 'c') printf("Shipping …
  9. Programming

    #include<stdio.h> int main() { char ch; printf("Enter Your State Name : "); scanf("%c",&ch); if(ch == 'a') printf("Shipping Charge : $25"); else if(ch == 'b') printf("Shipping Charge : $50"); else if(ch == 'c') printf("Shipping …
  10. C++ program

    #include<stdio.h> int main() { char ch; printf("Enter Your State Name : "); scanf("%c",&ch); if(ch == 'malacca') printf("Shipping Charge : $25"); else if(ch == 'pahang') printf("Shipping Charge : $50"); else if(ch == 'terengganu') …

More Similar Questions