Math and Arithmetic

Algebra

# What numbers go int 94?

###### Wiki User

###### July 18, 2013 10:55PM

1, 2, 47, 94.

## Related Questions

###### Asked in C Programming

### How do you write a program to generate 'n' Fibonacci numbers?

I don't program in just C (I use C++) so you may have to change
some of the code:
int main()
{
int n;
int last = 1;
int slast = 0;
int numbers[n];
numbers[0] = 1;
for(int i = 1; i < n; i++)
{
numbers[i] = last + slast;
slast = last;
last = numbers[i];
}
return 0;
}
int n needs to be set to however many Fibonacci numbers
you want to make.
int last is the last number in the sequence (so far)
int slast is the second last number in the sequence (so
far)
int numbers[n] is the int array which holds your
numbers
int i is the count for the loop, it is set to 1 because
before the loop, I set numbers[0] to 1

###### Asked in C Programming, Java Programming

### How do you write a program to find the sum of n numbers in an array?

In Java: // This program adds all numbers in the array int sum =
0; for (int i = 0; i < myArray.length(); i++) { sum +=
myArray[i]; }
In Java: // This program adds all numbers in the array int sum = 0;
for (int i = 0; i < myArray.length(); i++) { sum += myArray[i];
}
In Java: // This program adds all numbers in the array int sum = 0;
for (int i = 0; i < myArray.length(); i++) { sum += myArray[i];
}
In Java: // This program adds all numbers in the array int sum = 0;
for (int i = 0; i < myArray.length(); i++) { sum += myArray[i];
}

###### Asked in Math and Arithmetic, C Programming

### Write a C program to find the sum of odd numbers and even numbers from 1 to n using function?

Program to Find Sum of Odd & Even Numbers Using
Functions
#include<stdio.h>
#include<conio.h>
int j;
void main()
{
int sum_odd(int b[],int m);
int sum_even(int b[],int m);
int i,n,a[20];
clrscr();
printf("How many Numbers : ");
scanf("%d",&n);
printf("Enter n Numbers : \n");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("Summation of Odd Numbers : %d\n",sum_odd(a,n));
printf("Summation of Even Numbers : %d",sum_even(a,n));
getch();
}
int sum_odd(int b[],int m)
{
int sum=0;
for(j=0;j<m;j++)
{
if(b[j]%2!=0)
sum+=b[j];
}
return sum;
}
int sum_even(int b[],int m)
{
int sum=0;
for(j=0;j<m;j++)
{
if(b[j]%2==0)
sum+=b[j];
}
return sum;
}
Output :
How many Numbers : 10
Enter n Numbers :
1
2
3
4
5
6
7
8
9
10
Summation of Odd Numbers : 25
Summation of Even Numbers : 30

###### Asked in Math and Arithmetic

### Hoe can you write a programme to claculate 1 plus 2 plus 3..100?

You add the numbers in a loop. Here is an example in Java:
int sum = 0;
for (int i = 1; i <= 100; i++)
sum += i;
You add the numbers in a loop. Here is an example in Java:
int sum = 0;
for (int i = 1; i <= 100; i++)
sum += i;
You add the numbers in a loop. Here is an example in Java:
int sum = 0;
for (int i = 1; i <= 100; i++)
sum += i;
You add the numbers in a loop. Here is an example in Java:
int sum = 0;
for (int i = 1; i <= 100; i++)
sum += i;

###### Asked in Math and Arithmetic, C Programming, Algebra

### How do you find the largest of 3 numbers in computer programming?

To find the largest of three numbers you must first find the
largest of two numbers:
int max (int a, int b) { return a>b?a:b; // or, equivalently:
if (a>b) return a; else return b;
}
Now we can use this function to find the maximum of three:
int max3 (int a, int b, int c) {
return max (max (a,b), c);
}

###### Asked in C Programming

### Write a c program to find smallest among three numbers using scanf statement?

#include<iosys.h>
// return smallest of two numbers
int min (int a, int b) {
return a<b?a:b;
}
// return smallest of three numbers
int min3 (int a, int b, int c) {
return min (min (a, b), c);
}
int main () {
int a, b, c;printf ("Enter 3 numbers:\n");
scanf ("%d %d %d", &a, &b,&c);
printf ("Smallest number is %d\n", min3 (a, b, c));
return 0;
}

###### Asked in C Programming

### Write a c program to find the largest and second largest number out of 3 numbers?

// return the larger of any 2 numbers
int larger (int a, int b) {
return a>b?a:b;
}
// return the largest of any 3 numbers
int largest (int a, int b, int c) {
return larger (larger (a, b), c));
}
// return the middle value of any 3 numbers
int middle (int a, int b, int c) {
if (a>b) a^=b^=a^=b; // swap a and b (b is now the larger of
the two)
if (b>c) b^=c^=b^=c; // swap b and c (c is now the largest of
all three)
return larger (a, b); // return the larger of a and b
}