Question about Computers & Internet

1 Answer

Odd or integer?

A programme who differentiates 2 integer wether its odd or even

Posted by on

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    Superstar:

    An expert that got 20 achievements.

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

  • Master
  • 2,427 Answers

Hmm here is a psuedo to consider

input number n
while
n = n / 2
if n = 0 then print n = even , break loop
if n < 0 then print n is odd
loop

Posted on Jul 12, 2008

  • Rishi Roshan Ali Jul 12, 2008

    slighty correction use 1 instead of 0

×

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Describe the difference between binary semaphores and counting semaphores.


Binary semaphore is a semaphore with the integer value ranges over 0 and 1 whereas the counting semaphore's integer value ranges over unrestricted domain. Binary semaphores are easier to implement comparing with the counting semaphore.
Binary semaphore allows only one thread to access the resource at a time. But counting semaphore allows N accesses at a time.
The 2 operations that are defined for binary semaphores are take and release.
The 2 operations that are defined for counting semaphores are wait and signal

Sep 25, 2016 | Computers & Internet

1 Answer

How to reduce numbers with odd numerators and even denomanators


It doesn't matter whether they're even or odd. Divide both numerator and denominator by their greatest common divisor.

Jun 29, 2014 | Computers & Internet

1 Answer

What is an even number


An integer evenly divisible by 2.

Apr 21, 2014 | Computers & Internet

1 Answer

How can i display an even number if i enter an odd number in visual basic 6.0


To display an even number when an odd number is entered you can add 1.
n= val(text1.text) 'Take the value of n from the textbox.
If n mod 2 =1 then 'If n is an odd number n=n+1 'You make it an even number end if
text2.text = n 'Display it in another textbox.

Please give a good rating to this answer so that I will be encouraged to support people like you having problems with VB6.

Sep 22, 2011 | Computers & Internet

3 Answers

9999555533331111 out of these numbers any 6 numbers total is 21? how


this would be explained on the basis of two FACTS below.......
sum of two odd numbers are always even and
sum of to even numbers are also always even

then how 6 odd numbers (consider 3 pairs, 9 5 3 1 being odd numbers) can make an odd number 21..!!
SO SIMPLE
Make your basics strong...


Aug 14, 2010 | Computers & Internet

1 Answer

CABAL Online PH doesn't work on my Vista... anymore.


hi

if you can make sure that what version of service pack you are using on the operating system ,,,,,please try to check that wether it is 3 or 2......if it is 3 please try to downgrade it to 2 ,,and see wether it is wrking or not ..if it doesnot work then try to contact me on fixya or you can write me an email on ullekhtandon@gmail.com

Jul 17, 2009 | Microsoft Windows Vista Ultimate Edition

1 Answer

I need a complete workingsource code written in


This is a simple source code for Simple calculator in Java using RMI
//mathServer//
import java.rmi.*;
import java.rmi.Naming.*;
import java.rmi.server.*;
import java.rmi.registry.*;
import java.net.*;
import java.util.*;
interface mathInterface extends Remote
{
public int add(int a,int b) throws RemoteException;
public int subt(int a,int b) throws RemoteException;
public int mult(int a,int b) throws RemoteException;
public int div(int a,int b) throws RemoteException;
}
public class mathServer extends UnicastRemoteObject implements
mathInterface
{
public mathServer() throws RemoteException
{
System.out.println("Initializing Server");
}
public int add(int a,int b)
{
return(a+b);
}
public int subt(int a,int b)
{
return(a-b);
}
public int mult(int a,int b)
{
return(a*b);
}
public int div(int a,int b)
{
return(a/b);
}
public static void main(String args[])
{
try
{
mathServer ms=new mathServer();
java.rmi.Naming.rebind("MathServ",ms);
System.out.println("Server Ready");
}
catch(RemoteException RE)
{
System.out.println("Remote Server Error:"+ RE.getMessage());
System.exit(0);
}
catch(MalformedURLException ME)
{
System.out.println("Invalid URL!!");
}
}
}

//mathClient//
import java.rmi.*;
import java.rmi.registry.*;
import java.awt.*;
import java.awt.event.*;
public class mathClient extends Frame implements ActionListener
{
Button B1=new Button("Sum");
Button B2=new Button("Subtract");
Button B3=new Button("Multiply");
Button B4=new Button("Divide");
Label l1=new Label("Number 1");
Label l2=new Label("Number 2");
Label l3=new Label("Result");
TextField t1=new TextField(20);
TextField t2=new TextField(20);
TextField t3=new TextField(20);
public mathClient()
{
super("Calculator");
setLayout(null);
l1.setBounds(20,50,55,25);
add(l1);
l2.setBounds(20,100,55,25);
add(l2);
l3.setBounds(20,150,55,25);
add(l3);
t1.setBounds(150,50,100,25);
add(t1);
t2.setBounds(150,100,100,25);
add(t2);
t3.setBounds(150,150,100,25);
add(t3);
B1.setBounds(20,200,80,25);
add(B1);
B2.setBounds(100,200,80,25);
add(B2);
B3.setBounds(180,200,80,25);
add(B3);
B4.setBounds(260,200,80,25);
add(B4);
B1.addActionListener(this);
B2.addActionListener(this);
B3.addActionListener(this);
B4.addActionListener(this);
addWindowListener(
new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
);
}
public void actionPerformed(ActionEvent AE)
{
if(AE.getSource()==B1)
{
sum();
}
else if(AE.getSource()==B2)
{
subt();
}
else if(AE.getSource()==B3)
{
mult();
}
else if(AE.getSource()==B4)
{
div();
}
}
public void sum()
{
int i=Integer.parseInt(t1.getText());
int j=Integer.parseInt(t2.getText());
int val;
try
{
String ServerURL="MathServ";
mathInterface MI=(mathInterface)Naming.lookup(ServerURL);
val=MI.add(i,j);
t3.setText(""+val);
}
catch(Exception ex)
{
System.out.println("Exception:"+ex);
}
}
public void subt()
{
int i=Integer.parseInt(t1.getText());
int j=Integer.parseInt(t2.getText());
int val;
try
{
String ServerURL="MathServ";
mathInterface MI=(mathInterface)Naming.lookup(ServerURL);
val=MI.subt(i,j);
t3.setText(""+val);
}
catch(Exception ex)
{
System.out.println("Exception:"+ex);
}
}
public void mult()
{
int i=Integer.parseInt(t1.getText());
int j=Integer.parseInt(t2.getText());
int val;
try
{
String ServerURL="MathServ";
mathInterface MI=(mathInterface)Naming.lookup(ServerURL);
val=MI.mult(i,j);
t3.setText(""+val);
}
catch(Exception ex)
{
System.out.println("Exception:"+ex);
}
}
public void div()
{
int i=Integer.parseInt(t1.getText());
int j=Integer.parseInt(t2.getText());
int val;
try
{
String ServerURL="MathServ";
mathInterface MI=(mathInterface)Naming.lookup(ServerURL);
val=MI.div(i,j);
t3.setText(""+val);
}
catch(Exception ex)
{
System.out.println("Exception:"+ex);
}
}
public static void main(String args[])
{
mathClient MC=new mathClient();
MC.setVisible(true);
MC.setSize(600,500);
};
}

Jul 03, 2009 | Microsoft Computers & Internet

1 Answer

Factorial


1.In mathematics, the factorial of a non negitive integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example,
c018852104089c3b86ad5bba9e9223f9.png and4870ed458b29bbc1925d3466e81e4b0d.png2. Algorithm to find factorial of 6
1. Start
2. Take two variables i and j.
3. Take a constent VALUE=6.
4. Put i=1,j=1.
5. If i is less than VALUE goto 6 else goto 7
6. j=j*i and goto step 5
7. Print j value.
8. Stop.
/* Program to find factorial of 6 */

#include <stdio.h>

#define VALUE 6
int i,j;

void main()

{

j=1;

for (i=1; i<=VALUE; i++)

j=j*i;

printf("The factorial of %d is %d\n",VALUE,j);

}

Jan 19, 2009 | Computers & Internet

1 Answer

A java program that prints # then says whether the # is odd or even


int number = 10 //Insert the number here
if ((number % 2) == 0)  {  System.out.println(number+" is a even number);  } else {  System.out.println(number+" is a odd number); 
{
Let me know if you need a complete java class for this

Apr 15, 2008 | Computers & Internet

1 Answer

Read n & m, display the sum of all the even and odd numbers between n to m.


#include <stdio.h>

int main()
{
int n1, n2, i;
int sum = 0;
n1 = 3;
n2 = 11;

for (i = n1; i <= n2; i++) {
if (i % 2 == 0) {
printf("Adding %d\n", i);
sum = sum + i;
}
}
printf("sum = %d\n", sum);
return 0;
}

Feb 21, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

61 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

98762 Answers

David Payne
David Payne

Level 3 Expert

14037 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...