answersLogoWhite

0


Best Answer

#include <iostream>

using namespace std;

int main()

{

int i1, i2, i3;

char o;

cout << "Enter two integers sparated by an operator: ";

cin >> i1 >> o >> i2;

if ( o '/' && i2 != 0 )

{

i3 = i1 / i2;

cout << i1 << " / " << i2 << " = " << i3 << endl;

}

else

cout << "Input Error!" << endl;

return 0;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include<stdio.h>

void main()

{

int a,b,c;

printf("enter value of a and b:");

scanf("%d %d",&a,&b");

c=a+b;

printf("sum is %d",c);

c=a*b;

printf("\n product is %d"c);

c=a-b;

printf("difference is%d",c);

c=a/b;

printf('quotient is%d",c);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Implement calculator? To do math with integers you can do things like this:

int x = 1 + 1;

int y = x - 1;

int z = x * y;

int o = y / z;

You can also use more advanced things like:

+=

==(only for if statements)

-=

++

--

You can too change the variables that is already set:

x=1+1;

x=2-2;

x++;

x+= 1;

x-=1;

if(x == 1);

x--;

x = 1*1;

x = 1/1;

I hope this answered youre question!

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Private Sub Command1_Click()

dim a as integer

dim b as integer

dim c as integer

dim d as integer

a=txt1.text+txt2.text

b=txt1.text-txt2.text

c=txt1.text*txt2.text

d=txt1.text/txt2.text

msgbox "Sum: " & a & vbNewLine & "Difference :" & b & vbnewline & "Product :" & c &vbnewline& "Quotient :"& d,vbinformation,"Info"

End Sub

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that asks the user to enter 2 numbers obtains the two numbers from the user and print the sum products difference and quotient of the two numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why does the power point electricute me every time I stick my finger in it?

1. You are not very smart 2. If its the electrical outlet, its obviously obtains electricity. Therefore, it can electricute you


Does one have to enable Java Script to obtain Webmail.1 and l?

"According to all websites which discuss this question, it does appear that Javascript, a popular scriptin and programming language, needs to be enabled in order to run the application which obtains Webmail.1."


Difference between standard and canonical form?

The two CANONICAL FORMS of Boolean algebra are basic forms that one obtains from reading a function from the truth table. These forms are very seldom the ones with the least number of literals, because each minterm or maxterm must contain, by definition, all the variables either complemented or true form.Another way to express Boolean functions is in STANDARD FORM. In this configuration, the terms that form the function may contain one, two, or any number of literals.- Digital Design by Mano


How does rubber vulcanization work?

By far the most common vulcanizing methods depend on sulfur. Sulfur, by itself, is a slow vulcanizing agent and does not vulcanize synthetic polyolefins. Even with natural rubber, large amounts of sulfur, as well as high temperatures and long heating periods are necessary and one obtains an unsatisfactory crosslinking efficiency with unsatisfactory strength and aging properties. Only with vulcanization accelerators can the quality corresponding to today's level of technology be achieved.


What is recursive algorithm and write a recursive algorithm to reverse a string also trace it for any string data?

A recursive algorithm is an algorithm which calls itself with "smaller (or simpler)" input values, and which obtains the result for the current input by applying simple operations to the returned value for the smaller (or simpler) input. Heres a recursive algorithm to reverse a string char *rev(char str[],int pos1,int pos2) { if(pos1&lt;pos2) { char temp=str[pos1]; str[pos1]=str[pos2]; str[pos2]=temp; return rev(str,pos1+1,pos2-1); } return str; } You can call this function like this char *r=rev("reverse it",0,9);

Related questions

What obtains carbon and energy from the remain products or wastes of organisms?

producer


When a business obtains funds to expand or develop new products it is what?

generating ideas


What is an organism that obtains organic food molecules by eating other organisms or their by products and that cannot synthesize organic compounds from inorganic materials?

Heterotoph


What is an organism that obtains organic food molecules by eating other organisms or their by products and that cannot syntheize organic compounds from inorganic materials?

I believe it is an heterotroph.


Can credit card debt put a lien on your taxes?

Yes, if the creditor obtains a judgment lien in court.Yes, if the creditor obtains a judgment lien in court.Yes, if the creditor obtains a judgment lien in court.Yes, if the creditor obtains a judgment lien in court.


What is difference between ordering and buying retail merchandise?

The difference between ordering and buying is In ordering you obtains the delivery service from the shop to your destination and in case of Buying you don't use delivery services offered by the company.


An organism obtains food shelter and other resources from its?

An organism obtains food and resources from its habitat.


What is the difference between identity theft and impersonation?

Impersonation means to assume the character or appearance of another person. It often means to do so fraudulently, but it does not necessarily mean that.Identity theft is a crime where an imposter obtains pieces of personal information, such as Social Security or driver's license numbers with the goal of impersonating someone else.


What animal or plant consumes or obtains nutrientsfrom animals?

An animal or plant that obtains nutrients from animals is a carnivore.


What is the last step of the GPC Program process flow?

the ch obtains required approvals


How a seal obtains energy?

jkgkkrghkhgkehgkdfhgkdfhgkdgkdfjhgkfdjhkghdfk


When the body is exposed to sunlight it obtains?

It obtains a suntan (darkening of the skin), or sunburn, which is skin damaged by too long exposure to the sun's rays. Also vitamin D, essential for healthy bones, is also obtained.