answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Who invented gif?

Steve Wilhite, a software engineer, is credited with inventing the Graphics Interchange Format (GIF) in 1987. Despite the ongoing debate on how to pronounce it (spoiler alert: it's "jif," not "gif"), there's no denying that Wilhite's creation has become a staple of internet culture. So, give credit where credit's due, folks!

Write a program in java to print prime factors of a number?

import java.io.*;

class PrimeFactors

{

private boolean prime(int a)

{

boolean b=true;

for(int i=2;i<=(a/2);i++)

{

if(a%i==0)

b=false;

}

return b;

}

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the Number: ");

int a=Integer.parseInt(in.readLine());

PrimeFactors o=new PrimeFactors();

System.out.println("Prime Factors of "+a+" are::");

for(int i=1;i<=(a/2);i++)

{

if(a%i==0)

{

boolean b=o.prime(i);

if(b==true)

System.out.print(i+" ");

}

}

}}

Is it true that if you are good at mathematics and you enjoy mathematics and think very logically you can do programming?

I think so because my brother in law is computer scientist and he says that if you are good at mathematics so programming will be easy to learn for you.

1 to many relation?

Here is an example from Microsoft: Each customer can have many orders but each order belongs to a single customer. In relational database terminology, this is referred to as a one-to-many relationship.

How do you find the LCM of 10a6c8 2a7c8 15a8c8?

Factor the coefficients.

2

2 x 5

3 x 5

Combine the factors, eliminating duplicates.

Select the higher powers of the variables.

The LCM is 30a8c8

What is the pattern rule for pattern 35-21-1-13-15-34?

One possible rule is:

Un = (219n5 - 3755n4 + 24075n3 - 70645n2 + 92166n - 36960)/120

for n = 1, 2, 3, etc

Some equilateral triangles are not isoscles?

They are both different types of triangles one has 3 equal sides and the other has 2 equal sides.

How many sides are there in a die?

A standard six-sided die has six sides, as the name suggests.

However, dice can have four or more sides; the term die(or dice) does not imply a particular number of sides.

Some board games include dice with unusual shape and a number of sides different from six. Mathematicians also often conduct thought-experiments based on a notion of n-sided dice.

What is the difference between Dijkstra's algorithm and Floyd's algorithm?

Dijkstra doesn't support negative weight-age, Floyd support negative edges but no negative cycles. Dijkstra running time is v2 and Floyd has v3.Dijkstra is fast compared to Floyd, because only find the shortest path for single node. FloydSlow as compared to Dijkstra.

Why are people who have a solid background in math disadvantaged for programming?

Well, actually people who are good at math are usually pretty good at programming. Programming involves one creating an "equation" you could call it, to meet requirements. You create code to meet program requirements. It's like creating an formula to solve a problem.

What blaise pascal invented?

Pascal's Triangle in 1653. Which was also discovered 5 centuries earlier by Chinese mathematician Yang Hui.

Which numbers are prime number 1 to 200?

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199

Can decimal number always be accurately represented as a binary number?

No.

eg 0.1 is non terminating in binary and so would only ever be an approximation, just like 0.3, 0.33, 0.3333333 are all approximations of 1/3 (which is non terminating when represented as a decimal).