dynamically allocate memory for linear array of n
integers,store some elements in it and find some of them
Answer / vignesh1988i
#include<stdio.h>
#include<conio.h>
#include<alloc.h>
void main()
{
int *pointer,m,sum=0;
printf("enter the no. of elemrnts going to be entered :");
scanf("%d",&m);
pointer=(int*)malloc(m*sizeof(int));
for(int i=0;i<m;i++)
scanf("%d",(pointer+i));
for(i=0;i<m;i++)
sum=sum+(*(pointer+i));
for(i=0;i<m;i++)
printf("\n%d",sum);
getch();
}
thank u
| Is This Answer Correct ? | 3 Yes | 1 No |
Define function ?Explain about arguments?
2 Answers Geometric Software, Infosys,
What are the phases in s/w developed life cycle? wat is the diff b/w stack & queue...where do we use stack
Explain can the sizeof operator be used to tell the size of an array passed to a function?
6. Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod()
i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }
what is the difference between call by value and call by reference?
5 Answers Genpact, Global Logic, Infosys,
Write a program to print a (*)pattern programming (A to Z) in capital in one programming ?
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); }
27 Answers Advent Global Solutions, CitiGroup, Valeo Lighting Systems India Private Limited, Vishal Transformers, Wipro, Zencer,
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile?
if a five digit number is input through the keyboard, write a program to calculate the sum of its digits. (hint:-use the modulus operator.'%')
how can we use static and extern?and where can we use this?
What’s a signal? Explain what do I use signals for?