TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gaurav Kochhar
NA
2
550
My C language Basic Coding Problem.
Jul 23 2018 4:39 AM
//I am doing this with the pointer as:
#include <stdio.h>
#include <stdlib.h>
int *fun1(int ar[])
{
return ar;
}
int main()
{
int n,i,arr[10],*d;
printf("Enter the element of array:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
printf("Array you get from the function is:");
d=fun1(arr);
for(i=0;i<n;i++)
{
printf("%d\t",*(d+i));
}
return 0;
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
BUT Only with Array i am not doing same operation please give me solution.
#include <stdio.h>
#include <stdlib.h>
int * fun1(int ar[])
{
return ar;
}
int main()
{
int n,i,arr[10],d[10];
printf("Enter the element of array:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
printf("Array you get from the function is:");
d=fun1(arr);
for(i=0;i<n;i++)
{
printf("%d\t",(d+i));
}
return 0;
}
Reply
Answers (
0
)
Multiple selected dropdown value pass from viewTOcontroller
CSV file save in non editable mode.