Syntux Hub

Syntux Hub

Share

We develop Mobile Applications and webplatforms that are designed to the edge of your needs

21/10/2012

Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.

Read more: http://javarevisited.blogspot.com/2011/06/top-programming-interview-questions.html

18/10/2012

Calculator Challenge

The following program should function as a basic calculator; it should ask the user to input what type of arithmetic operation he would like, and then ask for the numbers on which the operation should be performed. The calculator should then give the output of the operation.

_______

___ multiply(int x, int y) { ______ x_y; }

____ divide(int x, int y) {
_____ x_y;
}
_____ add(int x, int y) { ______x_y; }
______ subtract(int x, int y) {
_____x_y;
}

using namespace std;

___ _____()
{
____ op='c';
____ x, y; while(op!='e')
{ cout__"What operation would you like to perform: add(+), subtract(-), divide(/), multiply(*), [e]xit?"; cin__op; switch(op) { ____ '+': cin__x; cin__y; cout__x__"+"__y__"="__add(x, y)__endl_ break; ____ '-'_ cin__x; cin__y; cout__x__"-"__y__"="__subtract(x, y)__endl_ break; ____ '/': cin__x; cin__y; cout__x__"/"__y__"="__divide(x, y)__endl_ break; ____ '*'_ cin__x; cin__y; cout__x__"*"__y__"="__multiply(x, y)__endl_ break; _____ 'e': ______; ______: cout__"Sorry, try again"__endl; }
} return _;
_

Want your business to be the top-listed Computer & Electronics Service in Kampala?
Click here to claim your Sponsored Listing.

Website

Address


Kampala
256