USER'S CHOICE POST

Internet Download Manager free download for life time activated
Top 10 software you must have in your computer/laptop/tab with free download link

Earn upto Rs. 9,000 pm checking Emails. Join now! And get Rs. 99 Instantly!

ALL THE INFORMATION GIVEN IN THIS SITE IS ONLY FOR THE LEARNING PURPOSE. WE SHOULD ALWAYS USE THE GENUINE SOFTWARE! USE OF ANY INFORMATION GIVEN HERE IS SOLELY USERS' RESPONSIBILITY!


Wednesday, 6 June 2012

Array addition

Filled under: ,

ADDITION OF TWO ARRAYS:



CODE:
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,a[3][3],b[3][3],c[3][3];
clrscr();
printf("Enter 9 no. one by one by giving space or enter:\n");
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
scanf("%d",&a[i][j]);
}
}
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
printf("\t%d",a[i][j]);
}
printf("\n");
}
printf("Enter 9 no.\n");
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
scanf("%d",&b[i][j]);
}
}
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
printf("\t%d",b[i][j]);
}
printf("\n");
}
printf("Array addition::\n");
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf("\t%d",c[i][j]);
}
printf("\n");
}
     /* for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
printf("    %d",c[i][j]);
printf("\n");
}   */
getch();
return 0;
}


DON'T FORGET TO JOIN THIS BLOG & LIKE OUR FB FAN PAGE.. SHARE IT WITH YOUR FRIEND

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...


Try New Whatsapp+ latest for free with lots of new Emoticons :) , Latest Version
Download NOW