C Program to find sum of two numbers



#include<stdio.h>
#include<conio.h>
void main(){
float radius,area,pi=3.14;
clrscr();
printf("Enter the radius:");
scanf("%f",&radius);
area=(pi*radius*radius);
printf("\nThe area of circle is:%f",area);
getch();
}

Explanation:

The above program will calculate the sum of two matrices and store the sum in third matrix. We can understand this process by the following example:

a[0]=4,a[1]=3,a[2]=2,a[3]=1
b[0]=2,b[1]=3,b[3]=1,b[4]=0
i=0
i<2,True
iteration1 (outer loop)
j=0
j<2,True
iteration1 (inner loop)
c[0][0]=a[0][0]-b[0][0]=2
Increment j by 1 now j=1
j<2,True
iteration2 (inner loop)
c[0][1]=a[0][1]-b[0][1]=0
Increment j by 1 now j=2
j<2,False
Increment i by 1 now i=1
i<2,True
iteration 2 (outer loop)
j=0
j<2,True
iteration1 (inner loop)
c[1][0]=a[1][0]-b[1][0]=1
Increment j by 1 now j=1
j<2,True
iteration2 (inner loop)
c[1][1]=a[1][1]-b[1][1]=1
Increment j by 1 now j=2
j<2,False
Increment i by 1 now i=2
i<2,False
loop break..
After subtraction of two matrices we get the following output

Output:

c program