The trouble is you think you have time. Your success depends on how you utilize your time.

Dry Run Practice Program 1

What will be the output of the following code:


#include<iostream>
using namespace std;
int main()
{
float arr[]={12.4,2.3,4.5,6.7};
cout<<sizeof(arr)/sizeof(arr[0]);
return 0;
}

For the Solution of this Question with explanation Click Here

6 comments:

  1. Sorry to say but your answer is wrong its '4'.
    Because arr[] has 4 elements which is the size, and size of the first element arr[0] is one so the answer is 4/1 = 4 ^^

    ReplyDelete
  2. bro i think ur wrong

    ReplyDelete
  3. what is the size of array

    ReplyDelete
  4. 16/4=4.... sizeof(arr)=16 bcz arr[] has 4 elements nd all the elements hav size 4 .so, 4*4=16 nd sizeof(arr[0])(size of frst element)=4.
    16/4=4....

    ReplyDelete