-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest29.c
More file actions
47 lines (40 loc) · 769 Bytes
/
test29.c
File metadata and controls
47 lines (40 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//Objective - Functions
//Date - Oct. 10, 2018
#include <stdio.h>
#include <conio.h>
void main(){
void facto(void); //function declaration (prototype)
facto(); //function calling
getch();
}
void facto() //function definition
{
printf("18BCAN013\n\n");
int i,n,f=1;
printf("Enter a number ");
scanf("%d",&n);
for(i=2; i<=n; i++){
f=f*i;
}
printf("Factorial is %d",f);
}
/*
#include <stdio.h>
#include <conio.h>
void facto() //function declaration
{
//function definition
printf("18BCAN024\n\n");
int n,i,f=1;
printf("Enter a number ");
scanf("%d",&n);
for(i=2; i<=n; i++){
f=f*i;
}
printf("Factorial is %d",f);
}
void main(){
facto(); //function calling
getch();
}
*/