Donate SIGN UP

please please someone help me!!!

Avatar Image
arianas | 06:51 Tue 29th Jul 2008 | Computers
3 Answers
please can someone please tell me the coding of how to make a program in C language

Q1:to find the factorial of a given number.
(factorial means that e.g. if the given number is 5 then the factorial will be 5x4x3x2x1=120)

Q2: create a program that will return the ASCII value of the character you type.

all has to be done is C. thank you so much in advance.

Gravatar

Answers

1 to 3 of 3rss feed

Best Answer

No best answer has yet been selected by arianas. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
Shouldn't really be doing your home/course work for you but as it's simple enough to find.

Here is a little program that prints the ascii code of any key

#include <stdio.h>
#include <conio.h>

#define ESC 27
int main(int argc, char* argv[])
{

int key;
while(1)
{
key = getch();
if(key == ESC)
break;
if(key == 0 || key == 224)
key = -getch();
printf("%d\n",key);
}
return 0;
}
Grab a copy of Kernighan and Ritchie and read.
lol

mad steve .... it'll be madteach if you're caught

1 to 3 of 3rss feed

Do you know the answer?

please please someone help me!!!

Answer Question >>