1. ## programs

Hey guys, I'm sorry to do this....i know ppl are not expected to do entire programs....but i really need these done asap!(before thursday!) . I'm in a bit of a tight situation....any help would be greatly appreciated. thanx

1) Write a function that accepts the lengths of three sides of a triangle and returns whether the triangle is right-angled or not.

2) Write a function, which given an integer Num, classifies it as ‘perfect’, ‘abundant’ or ‘deficient’. A number is perfect if the sum of its divisors (excluding the number itself) is equal to the number, e.g. 6. A number is abundant if the sum of its divisors (excluding the number itself) is greater than the number, e.g. 12. A number is deficient if it is neither perfect nor abundant.

3) Write a function, which accepts three arrays (integer type), two of these arrays contain sorted data which must be merged and placed in the third array. Assume that the third array contains enough empty locations to hold the data of both arrays.

4) Write a function which given an array of characters and the size of the array Max returns TRUE if the characters in the array form a palindrome (the same word spelt backwards and forwards, e.g. CIVIC) and FALSE otherwise.

5) Write a function, which accepts a number, Num and determines whether the number is prime or not.

6) Alex became bored one day and to break the monotony, he carried out an experiment with a row of mailboxes. These mailboxes were numbered 1 through 150 and beginning with mailbox 2, he opened the doors of all even-numbered mailboxes. Next beginning with mailbox 3, he went to every third mailbox, opening its door if it was closed and closing it if it was open. Then he repeated this procedure with every fourth mailbox, then every fifth mailbox, and so on. When he was finished he was surprised at the distribution of closed mailboxes. Write a program to determine which ones these were.

7) Write a function, which accepts an array and the number of items in the array and returns the location of the largest item in the array.

8) Write a function, which accepts an array and the number of items in the array and returns the largest item in an array.

2. I think I speak for all of us when I say: "Um, no. Do your own homework."

Quzah.

3. You know, if you actually approach your teacher after class and say "Teacher, I don't know how to approach this... Can you help me?" they will think you are wiser and be very happy to help you.

Do not be afraid to ask questions now, while you are young. It is really the only time you have where you get to ask as many questions as you like, no matter how "lame" they may seem-- and it's alright.

When you get older, you are expected to have the answers.

And if you are worried about peer pressure-- don't be. 5 years after you graduate, you won't even remember most of their names.

The only _fool_ is the one who DOESN'T ask questions when they need to...

Don't become a fool.

4. ...a dying programmer...
"I...I know the answer to all eight questions. I am weak but I will tell you the answers now. Ugh... (dies)"

Seriously, though. What have you written on your own? If you can't tackle any of it then why are you taking such a difficult course?

5. ## thanx

Hey guys, Thanx for all the advice and stuff....But i end up doing all of them on my own. I was just looking for the "easy way out".
It was 40% of my course mark...so i had to end up doing it!

6. ## I Got You Covered on The Triangle

#include<stdio.h>
#include<math.h>

void get_data(int *s1, int*s2, int*s3);
char determine_type(int s1, int s2, int s3);
void display_results(int s1, int s2, int s3, char);

int main (void)

{
int s1, s2, s3;
char type;
get_data(&s1, &s2, &s3);
type = determine_type)s1, s2, s3);
display_results(s1, s2, s3, type);
return0;
/********
* Input *
********/
void get_data (int *s1, int *s2, int *3)
{
printf ("Enter the lenght of side 1:");
*s1 = get_int();
printf ("Enter the length of side 2:");
*s2 = get_int();
printf ("Enter the lenght of side 3:");
*s3 = get_int();
}
/*Calculations*/
char determine_type(int s1, int s2, int s3)
{
char ret_val 'R'; /*Right Triangle*/
if ((s1*s1) + (s2*s2) == (s3*s3)&& (s3*s3)-(s1*s1) == (s2*s2)&&
(s3*s3) - (s2*s2) == (s1*s1))
{
ret_val = 'R';
}
else if
ret_val = 'N'
{
return ret_val;
}
void display_results(int s1, int s2, int s3, char type)
{
printf("The three sides %d. %d and %d\n", s1,s2,s3);
printf("DO NOT FORM A TRIANGLE.\n");
}
}
else
{
switch (type)
{
case 'R':
printf("Forms a Right Triangle.\n");
break;

default:
}
Hope this helps