Problem 04 | ArrayClass function

Problem : Take 10 Number as input, print 5th Number in another function

#include<stdio.h>

#include<conio.h>

#define n 10

void sum(int a);

/* prototype function */   void main(void)

{

clrscr();

int i,A[n];

printf(“\nEnter Number:…”);

for(i=1;i

sum(A[5]);        /*call function & print 5th number */

getch();

}

void sum(int a)

{

printf(“\nResult:%d”,a);

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s