help!!

S

Senai

if(make new array)this code:

#include "stdio.h"
#define N 8
sum(int a[N],int b[N])
{
int i,s[N];
for(i=0;i<N;i++)
{
s=a+b;
}
for(i=0;i<N;i++)
{
printf(" %5d",s);
}
}
main()
{
int a[N],b[N];
int i;
printf("\nPlease input integer:\n");
for(i=0;i<N;i++)
{
printf("Input A[%d],B[%d]:",i+1,i+1);
scanf("%d,%d",&a,&b); /*-----input
format:"5,5<cr>"------*/
}
printf("\nArray[A]:");
for(i=0;i<N;i++)
{
printf(" %5d",a);
}
printf("\nArray:");
for(i=0;i<N;i++)
{
printf(" %5d",b);
}
printf("\nArray:");
sum(a,b);
getch();
}
 
S

siya

You're right. I'm trying to evaluate this code,it helped me alot in
noticing readability. Thanks everyone spending time on my problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,175
Messages
2,570,944
Members
47,491
Latest member
mohitk

Latest Threads

Top