LEVEL-4. NOTE S System Define function #include void main() { int num; float r; clrscr();...
33
LEVEL-4 C- PROGRAMMING FUNCTION POINTER STRUCTURE UNION
LEVEL-4. NOTE S System Define function #include void main() { int num; float r; clrscr(); printf(“Enter any no\n”); scanf(“%d”,&num); r=sqrt(num); printf(“root
System Define function #include void main() { int num; float r;
clrscr(); printf(Enter any no\n); scanf(%d,&num); r=sqrt(num);
printf(root of %d is %f \n, num,r); getch(); }
Slide 4
NOTE S
Slide 5
Slide 6
User Define Function Parameter and no return value #include
void add(int, int); void main() { int a,b; clrscr(); printf(Enter
two number\n); scanf(%d%d,&a,&b); printf(Value of A
=%d\n,a); printf(Value of B =%d\n,b); add(a,b); getch(); }no return
void add(int x, int y) { with Parameter int z; z=x+y; printf(Sum of
two no = %d\n,z); }
Slide 7
User Define Function Parameter and return value #include int
add(int, int); void main() { int a,b,c; clrscr(); printf(Enter two
number\n); scanf(%d%d,&a,&b); printf(Value of A =%d\n,a);
printf(Value of B =%d\n,b); c=add(a,b); printf(Sum of two no =
%d\n,c); getch(); } with return int add(int x, int y) {with
parameter int z; z=x+y; return z; }
Slide 8
User Define Function No Parameter and no return value #include
void disp(); void main() { clrscr(); disp(); getch(); }no return
void disp() {no parameter int a,b,c; printf(Enter two number\n);
scanf(%d%d,&a,&b); printf(Value of A =%d\n,a); printf(Value
of B =%d\n,b); c=a+b; printf(Sum of two no = %d\n,c); getch(); }
*b) { printf(a is greater then b); } else { printf(b is greater
then a); }">
#include void greater(int*, int*); void main() { int a,b;
clrscr(); printf(Enter the value of a & b\n);
scanf(%d%d,&a,&b); greater(&a,&b); getch(); } void
greater(int *a, int *b) { if(*a>*b) { printf(a is greater then
b); } else { printf(b is greater then a); }