Results 1 to 4 of 4
Threaded View
-
9th Aug 2012, 08:36 AM #3OPMemberWebsite's:
android-apk.in latestplaza.com#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main(int argc, char *argv[])
{
int i,j,c,r,r1,row,row1;
int st[9],st1[9],st2[9];
FILE *f = fopen(argv[1], "r");
FILE *f1=fopen(argv[2],"r");
r=9;
r1=9;
/*initialize array*/
for(i=0;i<r;i++)
{
st[i]='\0';
}
for(i=0;i<r1;i++)
{
st1[i]='\0';
}
/*storing values in array from file*/
for(i=0;i<r;i++)
{
fscanf(f,"%d",&st[i]);
}
for(i=0;i<r1;i++)
{
fscanf(f1,"%d",&st1[i]);
}
row=(sizeof(st)/sizeof(int));
row1=(sizeof(st1)/sizeof(int));
for(i=0;i<r;i++)
{
if((st[i]=='\0')||(st1[i]=='\0'))
{
printf("Invalid matrix dimension\n");
exit(0);
}
}
/*printing input matrix*/
printf("Input Matrix1:\n");
for(i=0;i<r;i++)
{
printf("%d\t", st[i]);
}
printf("\n");
printf("Input Matrix2:\n");
for(i=0;i<r1;i++)
{
printf("%d\t", st1[i]);
}
printf("\n");
/*printing output matrix*/
printf("Output Matrix:\n");
for(i=0;i<r;i++)
{
st2[i]=st[i]+st1[i];
printf("%d\t", st2[i]);
}
printf("\n");
fclose(f);
fclose(f1);
return 0;
}
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
need this program (pay)
By Elleboy in forum Web Development AreaReplies: 20Last Post: 12th Jun 2011, 12:20 PM -
Not Selected for The Program (MEPI- Student Leaders Program)!!
By DoctorX in forum General DiscussionReplies: 0Last Post: 9th Feb 2011, 04:29 PM -
best gfx program
By Warez Junky in forum Graphics AreaReplies: 7Last Post: 26th Nov 2010, 06:44 AM -
Need some invoice program source code/or program only
By Nikolasr in forum Webmaster DiscussionReplies: 2Last Post: 1st Feb 2010, 10:55 AM
themaCreator - create posts from...
Version 3.55 released. Open older version (or...