3 votes 3 votes main( ) { int num[ ] = { 24, 34, 12, 44, 56, 17 } ; dislpay ( &num[0], 6 ) ; } display ( int *j, int n ) { int i ; for ( i = 0 ; i <= n - 1 ; i++ ) { printf ( "\nelement = %d", *j ) ; j++ ; } } Programming in C programming-in-c + – Parshu gate asked Nov 13, 2017 Parshu gate 1.2k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes one most important thing is compilation always start from 1st line of program.... now when compiler is getting on line where you call display() function..... there is no any function declaration at above ....that is... before you call any function we declare function()...so that compiler came to know that there is a function named as display().....and we may encounter its call... BUT in our code there is no declaration...as a result...compiler is unable to understand what is display()... and it will simply return compiler error SHUBHAM SHASTRI answered Nov 13, 2017 SHUBHAM SHASTRI comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments SHUBHAM SHASTRI commented Nov 13, 2017 reply Follow Share also write return types of all .. 0 votes 0 votes SHUBHAM SHASTRI commented Nov 13, 2017 reply Follow Share this is giving correct #include<stdio.h> void display(int *j,int n); int main( ) { int num[ ] = { 24, 34, 12, 44, 56, 17 } ; display( &num[0], 6 ) ; return 0; } void display( int *j, int n ) { int i ; for ( i = 0 ; i <= n - 1 ; i++ ) { printf ( "\nelement = %d", *j ) ; j++ ; } } 0 votes 0 votes Parshu gate commented Nov 13, 2017 reply Follow Share Lol my spelling of display was wrong :P . Thanks :) 0 votes 0 votes Please log in or register to add a comment.