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
How can you check to see whether a symbol is defined?
How does sizeof know array size?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Why c is a mother language?
what is recursion in C
Why shouldn’t I start variable names with underscores?
What is the function of multilevel pointer in c?
Explain the difference between malloc() and calloc() in c?
What is double pointer?
What are derived data types in c?
Explain a file operation in C with an example.
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
How to establish connection with oracle database software from c language?