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
void main()

      {

      int *mptr, *cptr;

      mptr = (int*)malloc(sizeof(int));

      printf(“%d”,*mptr);

      int *cptr = (int*)calloc(sizeof(int),1);

      printf(“%d”,*cptr);

      }
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }
Answer
# 1
Answer : 

      garbage-value 0

      Explanation:

The memory space allocated by malloc is uninitialized,
whereas calloc returns the allocated memory space
initialized to zeros.
 
Is This Answer Correct ?    0 Yes 0 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
Program to find the largest sum of contiguous integers in the array. O(n)  7
main() { main(); }  1
main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }  1
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?  1
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }  1
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }  1
write the function. if all the character in string B appear in string A, return true, otherwise return false. Google10
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }  1
Write a C function to search a number in the given list of numbers. donot use printf and scanf Honeywell4
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }  1
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. Synergy2
Program to Delete an element from a doubly linked list. Infosys4
main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. –3, -1, 1, 3, 5 HCL1
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }  1
Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable. Microsoft5
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above HCL1
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])  1
write a program in c to merge two array  1
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }  1
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }  1
 
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