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
What is a pointer in c?
What is derived datatype in c?
What are c identifiers?
What does char * * argv mean in c?
What are the basic data types associated with c?
Explain the properties of union.
What is operator promotion?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
Is void a keyword in c?
Why is not a pointer null after calling free?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Can a file other than a .h file be included with #include?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What are the 5 elements of structure?
provide an example of the Group by clause, when would you use this clause