ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
#define DIM( array, type) sizeof(array)/sizeof(type)

      main()

      {

      int arr[10];

      printf(“The dimension of the array is %d”, DIM(arr,
int));    

      }
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: #define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
Answer
# 1
Answer : 

      10   

      Explanation:

The size  of integer array of 10 elements is 10 *
sizeof(int). The macro expands to sizeof(arr)/sizeof(int) =>
10 * sizeof(int) / sizeof(int) => 10.
 
Is This Answer Correct ?    0 Yes 0 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
program to Reverse a linked list Ness-Technologies4
main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user HCL1
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }  1
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }  1
main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above HCL1
main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024 HCL1
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }  1
How we will connect multiple client ? (without using fork,thread) TelDNA2
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?  2
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }  1
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }  1
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }  1
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. Wipro2
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4 HCL1
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }  1
What are the files which are automatically opened when a C file is executed?  1
plz send me all data structure related programs  1
Find your day from your DOB? Microsoft12
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique. Microsoft4
how to return a multiple value from a function? Wipro2
 
For more C Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com