Input five numbers in two different array and print the sum of them.
#include <stdio.h>
#include <conio.h>
void main ( )
{
int n[5], n1[5], n2[5], i;
clrscr ( );
for ( i = 0; i < 5; i++ )
{
printf ("\n\t\t Enter a number in first array......:"); scanf ("%d", & n[i]);
}
for ( i = 0; i < 5; i++ )
{
printf ("\n\t\t\ Enter a number in second array......:"); scanf ("%d", & n1[i]);
}
printf ("\n\n\n\t\t\t The Sum of Array\n");
for ( i = 0; i < 5; i++ )
{
n2[i] = n[i] + n1[i];
printf ("\n\t\t\t\t %d + %d = %d", n[i], n1[i], n2[i]);
}
getch ( );
}
Click here to contact us
No comments:
Post a Comment