C Programming - Pointers - Discussion
Discussion Forum : Pointers - Find Output of Program (Q.No. 23)
23.
If the size of integer is 4bytes, What will be the output of the program?
#include<stdio.h>
int main()
{
int arr[] = {12, 13, 14, 15, 16};
printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0]));
return 0;
}
Discussion:
22 comments Page 3 of 3.
PRADEEP said:
2 decades ago
Thank you.
Pondey Ramu said:
2 decades ago
The array elements are 5 and the size is 4 then multiplying both we get 20 that is the size of the array and second one is size of the each array element and third one is size of the first array element that is 4 only thats why anwer 20,4,4
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers