C Lab
C Lab
DATE:
AIM:
ALGORITHM:
STEP 1: Start
PROGRAM:
#include<stdio.h>
void main()
{
int a,b,c;
printf("Please enter any two numbers: \n");
scanf("%d %d", &a, &b);
c = a+ b;
printf("The addition of two number is: %d", c);
}
OUTPUT:
Please enter any two numbers: 4 5 The
addition of two number is 9
RESULT:
EX .NO:1B PROGRAM TO PERFORM THE CALCULATOR OPERATIONS,
AIM:
ALGORITHM:
PROGRAM:
#include<stdio.h>
int add(int n1,int n2);
int subtract(int n1, int n2);
int multiply(int n1,int n2);
int divide(int n1,int n2);
int square(int n1);
int main()
{
int num1,num2;
printf("Enter two numbers:");
scanf("%d%d",&num1,&num2);
printf("%d + %d = %d\n", num1, num2, add(num1, num2));
printf("%d - %d = %d\n", num1, num2, subtract(num1, num2));
printf("%d * %d = %d\n", num1, num2, multiply(num1, num2));
printf("%d / %d = %d\n", num1, num2, divide(num1, num2));
printf(“%d^%d=%d\n”,num1,num1,square(num1));
return 0;
}
int add(int n1,int n2)
{
int result;
result=n1+n2;
return result;
}
int subtract(int n1,int n2)
{
int result;
result = n1 - n2;
return result;
}
int multiply(int n1,int n2)
{
int result;
result=n1*n2;
return result;
}
int divide(int n1,int n2)
{
int result;
result = n1 / n2;
return result;
}
int square(int n1)
{
int result; result = n1*n1;
return result;
}
OUTPUT:
20+5=25
20–5=15
20*5=100
20/5=4
20^20=400
RESULT:
EX .NO:2A C PROGRAM TO CHECK WHETHER A GIVEN NUMBER IS LEAP
AIM:
ALGORITHM:
PROGRAM:
#include <stdio.h>
int main() {
int year;
printf("Enter a year: ");
scanf("%d", &year);
return 0;
}
OUTPUT:
Enter a year: 2004 2004 is a leap year
RESULT:
EX .NO: 2B
C PROGRAM TO PRINT MULTIPLICATION TABLE USING GOTO
DARE STATEMENT
AIM:
ALGORITHM:
STEP1: Start
STEP3: Check if year is divisible by 400 then DISPLAY "is a leap year"
STEP4: Check if year is not divisible by 100 AND divisible by 4 then DISPLAY "is a leap year"
STEP6: Stop
PROGRAM:
#include <stdio.h>
int main()
{
int num,i=1;
printf("Enter the number whose table you want to print?");
scanf("%d",&num);
table:
printf("%d x %d = %d\n",num,i,num*i);
i++;
if(i<=16)
goto table;
}
OUTPUT:
Enter the number whose table you want to print?5
5x1=5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
5 x 11 = 55
5 x 12 = 60
5 x 13 = 65
5 x 14 = 70
5 x 15 = 75
5 x 16 = 80
RESULT:
EX NO:2C C PROGRAM TO CHECK WHETHER THE ENTERED CHARACTER IS
VOWEL OR NOT (USE SWITCH CASE)
DATE:
AIM:
ALGORITHM:
STEP1: Start
STEP3: Get the input from the user and compare with each cases
STEP5: End
PROGRAM:
#include<stdio.h>
int main()
{
char ch;
printf("Enter a character: ");
scanf("%c",&ch);
//condition to check character is alphabet or
if((ch>='A'&&ch<='Z')||(ch>='a'&&ch<='z'))
{
switch(ch)
{
case'A':
case'E':
case'I':
case'O':
case'U':
case'a':
case'e':
case'i':
case'o':
case'u':
printf("%c is a VOWEL.\n",ch);
break;
default:
printf("%c is a CONSONANT.\n",ch);
}
}
else
{
printf("%c is not an alphabet.\n",ch);
}
return 0;
}
OUTPUT:
Enter a character: 1
1 is not an alphabet.
RESULT:
EX NO: 2D C PROGRAM USING BREAK STATEMENT
DATE:
AIM:
ALGORITHM:
STEP1: Start
STEP2 : Declare and initialize the variables
STEP3: If the variable is greater than 15 then terminate the loop using break statement.
STEP 4: End
PROGRAM:
#include<stdio.h>
int main ()
{
int a =10;
while( a <20)
{
printf("value of a: %d\n", a);
a++;
if( a >15)
{
break;
}
}
return 0;
}
OUTPUT:
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
RESULT:
EX NO: 2E C PROGRAM USING CONTINUE STATEMENT
DATE:
AIM:
ALGORITHM:
STEP1: Start
STEP5: End
PROGRAM:
#include<stdio.h>
int main ()
{
int a =10;
do
{
if( a ==15)
{
a = a +1;
continue;
}
printf("value of a: %d\n", a);
a++;
}
while( a <20);
return 0;
}
OUTPUT:
value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 16
value of a: 17
value of a: 18
value of a: 19
RESULT:
EX NO: 3A C PROGRAM USING FOR LOOP
DATE:
AIM:
ALGORITHM:
STEP 1: Start
STEP 2: Declare and initialize the local variables
STEP 5: End
PROGRAM:
#include<stdio.h>
int main ()
{
int n, times=5;
for( n =1; n <= times; n = n +1)
{
printf("C for loops: %d\n", n);
}
}
return0;
}
OUTPUT:
C for loops: 1
C for loops: 2
C for loops: 3
C for loops: 4
C for loops: 5
RESULT :
EX NO: 3B C PROGRAM USING WHILE LOOP
DATE:
AIM:
ALGORITHM:
Step1: Start
Step2:Initializing the variables
Step5:End
PROGRAM:
#include<stdio.h>
#include<conio.h> int main()
{
int num=1;
while(num<=10)
{
printf(“%d\n”, num);
num++
}
return 0;
OUTPUT:
1
2
3
4
5
6
7
8
9
10
RESULT:
EX NO: 3C C PROGRAM USING DO-WHILE LOOP
DATE:
AIM:
ALGORITHM:
STEP1: Start
STEP2: Initializing the variables
STEP3:Perform do-while loop with condition
STEP 4: Check the Incrementing the operation
Step5: End
PROGRAM:
#include<stdio.h>
#include<conio.h>
int main()
{
int num=1;
do
{
printf("%d\n",2*num);
num++;
}while(num<=10);
return 0;
}
OUTPUT:
2
4
6
8
10
12
14
16
18
20
RESULT:
.
EX NO: 4A C PROGRAM FOR ACCESS ARRAY ELEMENTS
USING ONE DIMENSIONAL ARRAY
DATE:
AIM:
ALGORITHM:
STEP 1: Start
STEP 2: Initialize array name and array size.
STEP 3: Access the array elements after dynamic initialization
STEP 4: Print the result.
STEP 5: Stop.
PROGRAM:
#include<stdio.h>
int main() {
int nums[5];
printf("\n Run-Time Initialization Example:\n");
printf("\n Enter array elements: ");
return 0;
}
OUTPUT:
RESULT:
EX.NO: 4B C PROGRAM FOR TWO DIMENSIONAL ARRAY
DATE:
AIM:
ALGORITHM:
STEP 1: Start
STEP 2: Initialize array name and array size for 2d declaration.
STEP 3: Access the counter variables for the loop and display the array elements.
STEP 4: Print the result.
STEP 5: Stop.
PROGRAM:
#include<stdio.h> #include<conio.h>
int main()
{
int disp[2][3];
int i, j;
for(i=0; i<2; i++)
{
for(j=0;j<3;j++)
{
printf("Enter value for disp[%d][%d]:", i, j);
scanf("%d", &disp[i][j]);
}
}
printf("Two Dimensional array elements:\n");
for(i=0; i<2; i++)
{
for(j=0;j<3;j++)
{ printf("%d ", disp[i][j]);
if(j==2)
{
printf("\n");
}
}
}
return 0;
}
OUTPUT:
Enter value for disp[0][0]:1
Enter value for disp[0][1]:2
Enter value for disp[0][2]:3
Enter value for disp[1][0]:4
Enter value for disp[1][1]:5
Enter value for disp[1][2]:6
RESULT:
EX.NO:4C C PROGRAM FOR MULTI DIMENSIONAL ARRAY
DATE:
AIM:
ALGORITHM:
STEP 1: Start
STEP 2: Declare the 12 values entered by the user.
STEP 3: Displaying values using for loop
STEP 4: Printing values with proper index
STEP 5: Stop
PROGRAM:
#include<stdio.h>
int main()
{
int i,j,k;
int test[2][3][2];
printf("Enter 12 values:
\n");
printf("\nDisplaying values:\n");
for (i = 0; i < 2; ++i)
{
for(j = 0; j < 3; ++j)
{
for (k = 0; k < 2; ++k)
{
printf("test[%d][%d][%d] = %d\n", i, j, k, test[i][j][k]);
}
}
}
return 0;
OUTPUT:
Enter 12 values:
1
20
5
05
05
5
8
8
8
8
8
8
8
8
8
8
8
Displaying values:
test[0][0][0] = 1
test[0][0][1] = 20
test[0][1][0] = 5
test[0][1][1] = 5
test[0][2][0] = 8
test[0][2][1] = 8
test[1][0][0] = 8
test[1][0][1] = 8
test[1][1][0] = 8
test[1][1][1] = 8
test[1][2][0] = 8
test[1][2][1] = 8
RESULT:
EX.NO: 4D C PROGRAM TO DISPLAY ARRAY ELEMENTS USING
TRAVERSAL
DATE:
AIM:
ALGORITHM:
STEP 01: Start
STEP 02: Declare and initialize array.
STEP 03: Declare the size of array using size of(array)
PROGRAM:
#include<stdio.h>
#include<conio.h>
void main()
{
int i, size;
int arr[]={1, -9, 17, 4, -3};
size=sizeof(arr)/sizeof(arr[0]);
printf("The array elements are: ");
for(i=0;i<size;i++)
printf("\n arr[%d]= %d", i, arr[i]);
}
OUTPUT:
RESULT:
EX.NO: 5A C PROGRAM TO FIND STRING LENGTH
DATE:
AIM:
ALGORITHM:
#include<stdio.h>
#include<conio.h
int length;
length=strlen(s);
\n”,length);
return 0;
OUTPUT:
RESULT:
EX.NO:5B
PROGRAMTOCOMPARE THE TWO STRINGS USING STRING
DATE: FUNCTION
AIM:
ALGORITHM:
PROGRAM
#include <stdio.h>
#include<string.h>
int main()
{
char str1[20]; // declaration of char array
char str2[20]; // declaration of char array
int value; // declaration of integer variable
printf("Enter the first string : ");
scanf("%s",str1);
printf("Enter the second string : ");
scanf("%s",str2);
// comparing both the strings using strcmp() function
value=strcmp(str1,str2);
if(value==0)
printf("strings are same");
else
printf("strings are not same");
return 0;
}
OUTPUT:
Enter the first string: cse
Enter the second string:cse strings are same
RESULT:
EX .NO: 5C PROGRAM TO COPY CONTENT OF ONE STRING TO ANOTHER
STRING USING STRING FUNCTION.
DATE:
AIM:
ALGORITHM:
PROGRAM:
#include<stdio.h>
#include <string.h>
int main(){
char ch[20]={'c', 's', 'e', 'p', 'y', 't', 'h', 'o',’n’ '\0'};
char ch2[20];
strcpy(ch2,ch);
printf("Value of second string is: %s",ch2);
return 0;
}
OUTPUT:
RESULT:
EX.NO: 5D PROGRAM TO PERFORM STRING CONCATENATION
DATE
AIM:
ALGORITHM:
STEP1: Start
PROGRAM:
#include<stdio.h>
#include <string.h>
int main(){
char ch[10]={'h', 'e', 'l', 'l', 'o', '\0'};
char ch2[10]={'c', ‘s’,’e’,'\0'};
strcat(ch,ch2);
printf("Value of first string is: %s",ch);
return 0;
}
OUTPUT:
Value of first string is hello cse
RESULT:
EX.NO:5E PROGRAM TO REVERSE THE STRING USING STRING OPERATION
DATE:
AIM:
ALGORITHM:
PROGRAM:
#include<stdio.h>
#include <string.h>
int main()
{
char str[20];
printf("Enter string: ");
gets(str);
printf("String is: %s",str);
printf("\nReverse String is: %s",strrev(str));
return 0;
}
OUTPUT:
RESULT:
EX.NO: 6A PROGRAM TO SWAP TWO VALUES BY USING PASS BY VALUE
AIM:
ALGORITHM:
STEP 4: Print the value of actual parameters do not change by changing the formal parameters in call
by value,
STEP 5: stop.
PROGRAM:
#include<stdio.h>
int main()
{
double first, second, temp;
printf("Enter first number: ");
scanf("%lf", &first);
printf("Enter second number: ");
scanf("%lf", &second);
RESULT:
EX.NO:6
PROGRAM TO SWAP TWO VALUES BY USING PASS BY REFERENCE
DATE:
AIM:
ALGORITHM:
Program
#include<stdio.h>
void swap(int *,int *);
void main( )
{
int n1,n2;
printf("Enter the two numbers to be swapped\n");
scanf("%d%d",&n1,&n2);
swap(&n1,&n2);
}
void swap(int *n1,int *n2)
{
int temp;
temp=*n1;
*n1=*n2;
*n2=temp;
printf("\n After swapping are n1=%d n2=%d",*n1,*n2);
}
OUTPUT:
RESULT:
EX.NO: 7 PROGRAM TO FIND THE NTH TERM OF FIBONACCI SERIES USING
RECURSION
DATE:
AIM:
ALGORITHM:
PROGRAM:
#include<stdio.h>
int fibonacci(int);
void main ()
{
int n,f;
printf("Enter the value of n"); scanf("%d",&n);
f = fibonacci(n); printf("%d",f);
}
int fibonacci (int n)
{
if (n==0)
{
return 0;
}
else if (n == 1)
{
return 1;
}
else
{
return fibonacci(n-1)+fibonacci(n-2);
}}
OUTPUT:
Enter the value of n 12 144
RESULT:
EX.NO:8A
C PROGRAM FOR POINTERS TO
DATE: FUNCTION
AIM:
ALGORITHM:
STEP 1: Start
STEP 2: Initialize the function with an int parameter.
STEP 3: Declare fun_ptr is a pointer to function fun()
STEP 4: Invoking fun() using fun_ptr
STEP 5: Stop
PROGRAM:
#include <stdio.h>
void fun(int a)
{
printf("Value of a is %d\n", a);
}
int main()
{
void (*fun_ptr)(int) = &fun;
(*fun_ptr)(10);
return 0;
OUTPUT:
Value of a is 10
RESULT:
EX.NO: 8B
C PROGRAM FOR STRING POINTER
DATE:
AIM:
ALGORITHM:
PROGRAM
#include<stdio.h>
int main()
{
char str[6] = "Hello";
int i;
for(i = 0; str[i]; i++)
printf("&str[%d] = %p\n" ,i, str+i);
return 0;
}
OUTPUT:
&str[0] =0x7fff7b7234f2
&str[1] =0x7fff7b7234f3
&str[2] =0x7fff7b7234f4
&str[3] =0x7fff7b7234f5
&str[4] =0x7fff7b7234f6
RESULT:
EX.NO: 8C C PROGRAM FOR POINTERS TO
POINTERS
DATE:
AIM:
ALGORITHM:
STEP1: Start the program.
STEP2: Declare and initialize variables.
STEP3: Initialize pointer 1,2 for variables
STEP 4: Storing address of variable in ptr2
STEP 5: Storing address of ptr2 in ptr1
STEP 6: Displaying value of variable using both single and double pointers.
STEP 7: Stop the program.
PROGRAM:
#include <stdio.h>
int main()
{
int var = 789;
int *ptr2;
int **ptr1;
ptr2 = &var;
ptr1 = &ptr2;
printf("Value of var = %d\n", var );
printf("Value of var using single pointer = %d\n", *ptr2 );
printf("Value of var using double pointer = %d\n", **ptr1);
return 0;
}
OUTPUT:
RESULT:
.
EX.NO: 8D C PROGRAM FOR ARRAY OF POINTER
DATE:
AIM:
ALGORITHM:
STEP1: Initialize array name and
size. STEP2: Declare the elements
of array.
STEP3: Use %p print the value of pointer address.
PROGRAM:
#include<stdio.h>
#define size 5
int main()
{
int *arr[size];
int a = 10, b = 20, c = 30, d = 40, e = 50, i;
arr[0] = &a;
arr[1] = &b;
arr[2] = &c;
arr[3] = &d;
arr[4] = &e;
printf("Address of a = %p\n",arr[0]);
printf("Address of b = %p\n",arr[1]);
printf("Address of c = %p\n",arr[2]);
printf("Address of d = %p\n",arr[3]);
printf("Address of e = %p\n",arr[4]);
for(i = 0; i < size; i++)
printf("value stored at arr[%d] =
%d\n",i,*arr[i]);
return 0;
}
OUTPUT:
Address of a =0x7ffcd716b178
Address of b =0x7ffcd716b17c
Address of c =0x7ffcd716b180
Address of d =0x7ffcd716b184
Address of e =0x7ffcd716b18
value stored at arr[0] =10
value stored at arr[1] =20
value stored at arr[2] =30
value stored at arr[3] =40
value stored at arr[4] =50
RESULT:
EX.NO: 9A
C PROGRAM FOR NESTED STRUCTURES
DATE:
AIM:
ALGORITHM:
STEP1: Initialize the structure 1 and 2.
STEP2: Combine the two structure.
STEP3: Get the structure information
STEP4: Display the structure information
STEP5: Stop the program
PROGRAM:
#include <stdio.h>
struct student_college_detail
{
int college_id;
char college_name[50];
};
struct student_detail
{
int id;
char name[20];
float percentage;
struct student_college_detail clg_data;
}
stu_data;
int main()
{
struct student_detail stu_data = {1, "Raju", 90.5, 71145,
"Anna University"};
printf(" Id is: %d \n", stu_data.id);
printf(" Name is: %s \n", stu_data.name);
printf(" Percentage is: %f \n\n", stu_data.percentage);
printf(" College Id is: %d \n", stu_data.clg_data.college_id);
printf(" College Name is: %s \n", stu_data.clg_data.college_name);
return 0;
}
OUTPUT:
Id is: 1
Name is: Raju
Percentage is: 90.500000
RESULT:
EX.NO: 9B
AIM:
ALGORITHM:
STEP1: Declare the structure name as student.
STEP2: Initialize the variables.
STEP3: Get details of the student
STEP4: Print the result
STEP5: Stop
PROGRAM:
#include<stdio.h>
struct student
{
int sno;
char
sname[30];
float marks;
};
main ( ){
struct student s;
struct student
*st;
printf("enter sno, sname, marks:");
scanf ("%d%s%f", & s.sno, s.sname, &s. marks);
st = &s;
printf ("details of the student are");
printf ("Number = %d\n", st ->sno);
printf ("name = %s\n", st->sname);
printf ("marks =%f\n", st ->marks);
getch ( );
}
OUTPUT:
enter sno, sname, marks:3
Lucky 88 details of the
student are:
Number
= 3 name
= Lucky
marks =88.000000
RESULT:
EX.NO: 9C C PROGRAM FOR STRUCTURES AND UNION
DATE:
AIM:
ALGORITHM:
STEP 01: Start
STEP 02: Declaring structure and union.
STEP 03: Creating variable for structure and initialize the values
STEP 04: Creating variable for union and initialize the values
PROGRAM:
#include <stdio.h>
#include
<string.h>
struct struct_example
{
int integer;
float decimal;
char name[20];
};
union union_example
{
int integer;
float decimal;
char name[20];
};
void main()
{
struct struct_example stru ={5, 15, "John"};
union union_example uni = {5, 15, "John"}
printf("data of structure:\n integer: %d\n decimal: %.2f\n name: %s\n", stru.integer, stru.decimal, stru.name);
printf("\ndata of union:\n integer: %d\n" "decimal: %.2f\n name: %s\n", uni.integer, uni.decimal, uni.name);
printf("\nAccessing all members at a time:");
stru.integer = 163;
stru.decimal = 75;
strcpy(stru.name, "John");
printf("\ndata of structure:\n integer: %d\n " "decimal: %f\n name: %s\n", stru.integer, stru.decimal, stru.na
me);
uni.integer = 163;
uni.decimal = 75;
strcpy(uni.name, "John");
printf("\ndata of union:\n integeer: %d\n " "decimal: %f\n name: %s\n", uni.integer, uni.decimal, uni.name);
data of structure:
integer: 5
decimal: 15.00
name: John
data of union:
integer: 5
decimal:0.00
name:John
data of union:
integer: 1852337994
decimal: 17983765624912253034071851008.000000
name: John
RESULT:
EX.NO:10A
AIM:
ALGORITHM:
STEP 1: Start
STEP 2: Declare the file pointer
STEP 3: Get the data to be written in file
STEP 4: Open the existing file GfgTest.c using fopen() in write mode using "w" attribute
STEP 5: Check if this file Pointer is null which maybe if the file does not exist
STEP 6: Write the data To Be Written into the file
STEP 7: Writing in the file using fputs()
STEP 8: Closing the file using fclose()
STEP 9: Stop
PROGRAM:
# include <stdio.h>
# include <string.h>
int main( )
{
FILE *filePointer ;
char dataToBeWritten[50]
= "GeeksforGeeks-A Computer Science Portal for Geeks";
filePointer = fopen("GfgTest.c",
if ( filePointer == NULL )
{
printf( "GfgTest.c file failed to open." ) ;
}
else
printf("The file is now opened.\n")
// Write the dataToBeWritten into the file
if ( strlen ( dataToBeWritten ) > 0 )
{
// writing in the file using fputs()
fputs(dataToBeWritten, filePointer) ;
fputs("\n", filePointer) ;
} // Closing the file using fclose()
fclose(filePointer) ;
printf("Data successfully written in file GfgTest.c\n");
printf("The file is now closed.") ;
}
return 0;
}
OUTPUT:
The file is now opened.
Data successfully written in file GfgTest.c
The file is now closed.
RESULT:
EX.NO: 10B
C PROGRAM FOR FILE OPERATIONS READ A FILE
DATE:
AIM:
ALGORITHM:
STEP 1: Start
STEP 2: Declare the file pointer
STEP 3: Declare the variable for the data to be read from file
STEP 4: Open the existing file GfgTest.c using fopen() in read mode using "r" attribute
STEP 5: Read the data To Be Read from the file using fgets() method
STEP 6: Closing the file using fclose()
STEP 7: Stop
PROGRAM:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Driver code
int main()
{
FILE* ptr;
char ch;
// Opening file in reading mode
ptr = fopen("test.txt", "r");
if (NULL == ptr) {
printf("file can't be opened \n");
}
printf("content of this file are \n");
// Printing what is written in file
// character by character using loop.
do {
ch = fgetc(ptr);
printf("%c", ch);
// Checking if character is not EOF.
// If it is EOF stop reading.
} while (ch != EOF);
// Closing the file
fclose(ptr);
return 0;
}
OUTPUT:
c:\Desktop\program\test.txt
c”\Desktop\program\test.txt
content
This is Programming in C
RESULT:
EX.NO:10C C PROGRAM TO DEMONSTRATE RANDOM
ALGORITHM:
STEP1: Start
STEP2: Declare the file pointer
STEP 3: The file pointer points to the starting of the file, ftell() will return 0
STEP 4: Here we traverse the entire file and print it's contents until we reach it's end.
STEP 5: Print Size of file in bytes
STEP 6: Stop
PROGRAM:
#include<stdio.h>
int main()
{
FILE *fp;
fp=fopen(“scaler.txt”, “r”);
if(!fp)
{
printf(“Error : File cannot be opened \n” );
return 0;
}
printf(“position pointer in the beginning : %d\n”, ftell(fp));
char ch;
while(fread(&ch,sizeof(ch),1,fp)==1)
{
printf(“%c”, ch);
}
printf(“\n Size of file in bytes is : %d” \nftell (fp));
fclose(fp);
return0;
}
OUTPUT:
RESULT:
EX .NO:10D C PROGRAM TO DEMONSTRATE FILE PREPROCESSOR
DIRECTIVES
DATE:
AIM:
ALGORITHM:
STEP1: Start
STEP2: Declare the macro with parameter
STEP 3: Initialize two values and define macro
STEP 4: Calculate the area of rectangle
STEP 5: Print the result.
STEP 5: Stop
PROGRAM:
#include<stdio.h>
#define
AREA(1,b)(1*b) int
main()
{
int 11=10, 12=5,
area;
area=AREA(11,12);
printf(“Area of rectangle is:%d”, area);
return 0;
}
OUTPUT:
Area of rectangle is:50
RESULT: