Answer Posted / nithin
int main()
{
int i, max;
// Array
int *a;
printf("Enter the size of array\n");
scanf("%d", &max);
//Run time size allocation of an array
a = (int*)malloc(max * sizeof(int));
for(i = 0; i < max;i++)
{
a[i] = i * 2;
printf("value of element %d is %d\n", i, a
[i]);
}
return 0;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write a code to remove duplicates in a string.
What is the use of #define preprocessor in c?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
what is stack , heap ,code segment,and data segment
Why is this loop always executing once?
Explain what is operator promotion?
What is methods in c?
What is the difference between procedural and declarative language?
Write a program to swap two numbers without using the third variable?
What is a program flowchart and explain how does it help in writing a program?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
What is difference between far and near pointers?
What is a double c?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
Can we declare variable anywhere in c?