INTERVIEW QUESTIONS
LANGUAGES
C DETAILS
Question :
Output of this Programme please?? main() { int a[]={2,4,6,8,10}; int i; change(a,5); for(int i=0;i<=4;i++) printf("
%d", a[i]); } change(int *b,int n) { int i; for(i=0;i *(b+i) = *(b+i)+5; } sytaxis correct?? was asked i a test
Answers:
I think the syntax is incorect in the for loop of the change function, it sould have atleast a closing ')'. Secondly, if the function defination is given after the function calling, then the proper prototype of the function must be declared before the calling of the function, other wise compiler declares a default prototype by considering each parameters as well as the return type as integer, which leads into the compiler error "type mismatch in redeclaration of the function".
int a[]={2,4,6,8,10}; it should be int a[4]={2,4,6,8,10};
 Posted by: MUHAMMAD AAMIR SAYEED
Contact MUHAMMAD AAMIR SAYEED
If you have the better answer, then send it to us. We will display your answer after the approval.
   
Related Questions
View Answer
Can we use string in switch statement?
View Answer
How can you calculate number of nodes in a circular Linked List?
View Answer
What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
View Answer
Where are the auto variables stored? What is the use of register variables?
View Answer
c program for delete a node from linked list
View Answer
What is the differece between #define and constant in C?
View Answer
How can we open a image file through C program
View Answer
In c , main() is a function . and where is defined main() in c. bcz every function has three parts. 1>. decleration 2>. definition. 3>. calling
View Answer
What is wrong with the following c program? char *s1 = "hello"; char *s2 = "world"; char *s3 = strcat(s1, s2); Please provide me explanations??
View Answer
Between a long pointer and a char pointer , which one consumes more memory? explain
View Answer
Please Note : We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
Notify me when better answer is posted!
View ALL C Interview Questions