• Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • English APP
  • login
  • Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • Walkins
    • Corporate Job Exam
    • Government Job Exam
    • Entrance Exam
  • Training
    • Internship
  • Placement Questions
  • /
  • C

Frequently Asked c interview questions and answers for freshers Page 17

c Select Another Category Select Another Topic

Programming and Technical

  • Android 118
  • ASP.NET 60
  • C 459
  • C++ 448
  • DATA STRUCTURE 66
  • DBMS 77
  • ELECTRONICS 39
  • Java 261
  • OOPs Concepts 117
  • Operating Syst 103
  • RDBMS 109
  • UNIX 70

c Question Topics

    Category (16)

    General Ability (2)

  • General Knowledge (2)
  • HR Interview (2)

  • Interview (2)
  • Logical Reasoning (9)

  • Coding Decoding (2)
  • Cryptography (1)
  • General Mental Ability (1)
  • Letter Series (1)
  • Mathematical Reasoning (1)
  • Missing Character (1)
  • Seating Arrangement (1)
  • Numerical Ability (12)

  • Age Problem (1)
  • Algebra (1)
  • Alligation or Mixture (1)
  • Data Interpretation (1)
  • Height and Distance (1)
  • Percentage (2)
  • Ratio and Proportion (1)
  • Time Distance and Speed (1)
  • Programming (218)

  • Arrays (15)
  • Basics (8)
  • Database (6)
  • Definition (25)
  • Functions (4)
  • Output (42)
  • Program (85)
  • Puzzles (1)
  • Technical (24)
  • Variables (1)
  • Verbal Ability (3)

  • Antonyms (1)
  • Miscellaneous (1)
  • Spotting Errors (1)
Keep an EYE (0)
Solved Question (6) UnSolved Question (454)
Pages: 46FirstPrev13141516171819202122NextLast
Advertisements

(#M40157038) C QUESTION Logical series Keep an EYE Keep an eye puzzle Keep an eye puzzle

W.A.P
23,21,24,19,26,15,28,11,30,7,36...............N

Asked In C md shabbir ahmad (9 years ago)
Unsolved Read Solution (3)
Is this Puzzle helpful?   (9)   (4) Submit Your Solution

(#M40029257) C QUESTION C Keep an EYE Keep an eye puzzle Keep an eye puzzle

output??
Q.
void main()
{i
nt i=5;
printf("%d",i++ + ++i);
}

A. Output Cannot be predicted exactly.

Explanation: Side effects are involved in the evaluation of i

Asked In C MAN (12 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (1)   (1) Submit Your Solution
Advertisements

(#M40165321) C QUESTION next biggest number Keep an EYE Keep an eye puzzle Keep an eye puzzle

find the next biggest number
8,4,2,9,6,3
ans:8->9,4->2,2->3,9->,6->8,3->4

Asked In C dharani (7 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (8)   (3) Submit Your Solution Arrays

(#M40037094) C QUESTION C-PROGRAMING Keep an EYE Keep an eye puzzle Keep an eye puzzle

Type duplicates of a row in a table customer with non uniform key field customer number you
can see
a) delete from costomer where customer number exists( select distinct customer number from
customer having count )
b) delete customer a where customer number in b rowid
c) delete customer a where custermor number in( select customer number from customer a,
customer b
d) none of the above
CHOOSE THE CORRECT OPTION

Asked In C gowtham (11 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (0)   (5) Submit Your Solution Miscellaneous

(#M40018775) C QUESTION C- QUESTIONS Keep an EYE Keep an eye puzzle Keep an eye puzzle

A pointer to a function which receives nothing and
returns nothing

Asked In C (12 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (2)   (2) Submit Your Solution Arrays

(#M40037089) C QUESTION C-PROGRAMING Keep an EYE Keep an eye puzzle Keep an eye puzzle

find the output
main()
{
printf("%d%d"size of ("Hcl
technologies"),strlen("HCL Technologies"));
}

Asked In C gowtham (11 years ago)
Unsolved Read Solution (22)
Is this Puzzle helpful?   (7)   (4) Submit Your Solution Program

(#M40152783) C QUESTION Increment operator Keep an EYE Keep an eye puzzle Keep an eye puzzle

void main()
{
printf("%%%%");

}

Asked In C Akhilesh Pandey (10 years ago)
Solved bk thapa Read Solution (18)
Is this Puzzle helpful?   (11)   (6) Submit Your Solution Database

(#M40155234) C QUESTION pointer Keep an EYE Keep an eye puzzle Keep an eye puzzle

ARRAY-SHEET
Q1. main()
{
int n=10;
int a[n];
printf("n %d bytes",sizeof(a));
}
(a) compilation error (b) garbage values (c) 20 bytes (d) 10 bytes

Q2. main()
{
int a[]={1,2,3}, i, sum=0, *p, *q;
q=p=a;
for(i=0;i<3;i++)
{
++*p++;
printf(" %d", q[i]);
}
}
(a) 1 2 3 (b) 2 3 4 (c) all garbage values (d) no output

Q3. main()
{
int a[25];
a[0]=46;
a[24]=50;
printf("%d %d",a[24]-a[0],&a[24]-&a[0]);
}
(a) compilation error (b) 24 24 (c) 46 50 (d) 4 24

Q4. main()
{
int a[2]={10,20}, *p, i=1;
p=&a+1;
p--;
for(;i>=0;)
{
printf("%d ", *p--);
i--;
}
}
(a) 20 10 (b) 10 20 (c) 11 21 (d) 21 11

Q5. main()
{ static int a[]={2,4,6};
static int *p[]={a,a+1,a+2};
int *q[]={a+2,a+1,a} , *ptr, i;
for(i=0;i<3;i++)
a[i]=**p+**q;
for(i=0;i<3;i++)
printf("%d ",a[i]); }
(a) 4 8 12 (b) 12 12 12 (c) 8 14 14 (d) 2 4 6

Q6. main()
{ static int a[]={2,4,6};
static int *p[]={a,a+1,a+2};
int *q[]={a+2,a+1,a}, *ptr, i; ;
for(i=0;i<3;i++)
a[i]=*p[i]+*q[i];
for(i=0;i<3;i++)
printf("%d ",a[i]); }
(a) 4 8 12 (b) 12 12 12 (c) 12 22 22 (d) 8 8 14

Q7. Suppose the array a starts with the base address 170 andarray p starts with the base address 180
main()
{ static int a[]={10,12,14,16,18};
static int *p[]={a,a+1,a+2,a+3,a+4} , **ptr, *s;
ptr=p+0;
s=a+0;
printf("n %u %u %d %d ",s,ptr,*s,**ptr);
ptr++; s++;
printf("n %u %u %d %d ",s,ptr,*s,**ptr);
*ptr++; *++s;
printf("n %u %u %d %d ",s,ptr,*s,**ptr);
++*ptr; ++*s;
printf("n %u %u %d %d ",s,ptr,*s,**ptr);
*ptr++; *s++;
printf("n %u %u %d %d ",s,ptr,*s,**ptr); }

Q8. main() {
int a[5]={10,20,30,40,50},*p;
int i;
p=a;
for(i=0;i<3;i++)
printf(" %.4d ",++p[i]); }
(a) 10 20 30 (b) 0010 0020 0030 (c) 0011 0021 0031 (d) all garbage

Q9. main()
{ int a[][2][3]={ { {1,2,3}, { 4, 5, 6} },
{ {7,8,9}, {10,11,12} }
};
printf("%u ",***a+1+1+2);
printf("%u ", ***(a+1)+1+2);
printf("%u ",**(*(a+1)+1)+2);
printf("%u ",*(*(*(a+1)+1)+2)); }
(a) error (b) 1 12 12 12 (c) 1 10 11 12 (d) 5 10 12 12

Q10. main()
{ int a[]={10,20,30};
int *p[3]={a}, i;
for(i=0;i<3;i++)
printf("%u ",p[i]);
} suppose the base address of array a is 170
(a) 170 172 174 (b) 170 0 0 (c) 170 and garbage addresses (d) no output

Q11. main()
{ float x[3][3][3]={1.5,2.5};
printf("%.2f %.2f",x[0][0][0],x[2][2][2]); }
(a) 1.50 garbage value (b) 1.50 2.50 (c) 0.00 0.00 (d) 1.50 0.00 ( e) none of these

Q12. main()
{ int a[5]={10,20,30,40,50}, *p;
p=a+4;
p[-2]=50;
printf("n%u %d",p[-2],a[2]); }
(a) 30 50 (b) error (c) 30 30 (d) 50 30 (e) none of these

Q13. main()
{ int a[3]={10,20,30},*p;
for(p=a;p<&a[3];p++)
{ *p=p-a;
printf("%d ",*p); }
}
(a) 10 20 30 (b) garbage values (c) 1 2 3 (d) 0 1 2 (e) none of these

Q14. main()
{
int a[3][3];
printf("%u ",&a+0);
printf("%u ",&a+1);
}
if the base address is 65506
(a) 65506 65508 (b) 65506 65518 (c) 65506 65526 (d) 65606 65524

Q15. main()
{
int a[]={10,20,30} , (*p)[3]=a , i;
for(i=0;i<3;i++)
printf("%d ",(*p)[i]);
}
(a) 10 20 30 (b) 10 0 0 (c) 10 10 10 (d) 10 and all garbage values

Q16. What will be the value of a[i] will be printed out in this program?.
main() {
int a[3] , i;
for(i=0;i<3;i++)
{
a[i]=printf("abcde"+i);
printf("%d",a[i]);
} }
(a) 97 98 99 (b) 1 2 3 (c) 5 4 3 (d) all garbage values

Q17. main()
{ int a[]={10,20,30}, i,*p,j=0;
for(i=0;i<3;i++)
{
p=&a[i];
++*p++;
++a[j++];
printf("%d ",a[i]);
}
}
(a) 10 20 30 (b) 11 21 31 (C) 12 22 32 (d) 13 23 33

Q18. main()
{ int a[]={10,11,12}, I;
for(I=0;I<3;I++)
++*a;
for(I=0;I<3;I++)
printf(“%d”,a[I]);
}
(a) error (b) 10 11 12 (c) 11 12 13 (d) 12 13 15 (e) 13 11 12

Q19. main()
{ int a[][3]={1,2,3,4,5,6};
int (*p)[]={a};
printf(“%d %d”,(*p)[1],(*p)[2]);
*p++;
printf(“%d %d”,(*p)[1],(*p)[2]); }
(a) 2 3 5 6 (b) 2 3 4 5 (c) 4 5 0 0 (d) compilation error

Q20 main()
{ char a[ ]="Jyotir";
char b[ ]="Janmay";
char c[10];
c=a;
a=b;
b=c;
printf("%s %s",a,b); }
(a) Jyotir Janmay (b) Janmay Jyotir (c) Jyotir Jyotir (e) error

Q21 main()
{ char *a="Jyotir";
char *b="Janmay";
char *c;
c=a;
a=b;
b=c; printf("n %s %s ",a,b); }
(a) Jyotir Janmay (b) Janmay Jyotir (c) Jyotir Jyotir (d) Janmay Janmay

Q22 main()
{
int *p=&"Janmayjay";
printf("%s",p);
}
(a) Compiolation Error (b) garbage (c) J (d) Janmayjay (e) none of these

Q23 main()
{ char a[10][10];
char *b[10];
char (*c)[10];
printf("n %d %d %d",sizeof(a),sizeof(b),sizeof(c));
}
(a) 100 10 10 (b) 200 20 20 (c) 100 20 2 (d) none of these

Q24. main()
{
char *a[2]={"Jyotir" , "Janmay"};
printf("n%s",*a+1);
printf("n%s",*(a+1));
}
(a) Jyotir Janmay (b) Janmay Janmay (c) yotir Janmay (d) none of thsee

Q25. main()
{ static char *a[]={"Sanjay Sapra", "Janmayjay Sapra", "Jyotirmay Sapra"};
printf("%s",*(a+2)-16); }
(a) Jyotirmay Sapra (b) Sanjay Sapra (c) Janmayjay Sapra (d) none of these

Q26. main()
{ char a[]="AABBCC";
int i;
for(i=0;i<3;i++)
printf("%d",(int)a[i]);
}
(a) compilation error (b) 65 65 66 (c) 65 65 66 66 67 67 (d) 65 66 67

Q27. main()
{ char a[0];
printf("%d",sizeof(a));
}
(a) compilation error (b) 1 (c) 2 (d) 0

Q28. main()
{
char s[ ]={'a','b','c','n','c',''};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
}

Q29. What will be the output of this program if I store 3 strings
at time of scanf( ). “Sanjay” “Jyotirmay” “Janmayjay”
main( )
{ char *q;
int j;
for (j=0; j<3; j++) scanf(“%s” ,(q+j));
for (j=0; j<3; j++) printf(“%c” ,*(q+j));
for (j=0; j<3; j++) printf(“%s” ,(q+j));
}
(a) S J J Sanjay Jyotirmay Janmayjay (b) S J J
(c) S J J Sanjay anjay njay (d) S J J SJJanmayjay JJanmayjay Janmayjay

Q30 main()
{
char *p;
p="%dn";
p++;
p++;
printf(p-2,300);
}

Q31. main()
{
char *p = “Iyqm”;
char c;
c = ++*p++;
printf(“%c”,c);
printf(“%s”,p);
}

Q32.
void main()
{ printf(“sizeof (void *) = %d n“, sizeof( void *));
printf(“sizeof (int *) = %d n”, sizeof(int *));
printf(“sizeof (double *) = %d n”, sizeof(double *));
printf(“sizeof(struct unknown *) = %d n”, sizeof(struct unknown*));
}

Q33. main()
{ char a[ ]={10,20,30,40,50,60,70,80};
char *ptr;
ptr=&(a+2)[5];
printf(“%d”,*ptr);
}

Q34.
main()
{
char *str;
str=(char*) malloc(12);
strcpy(str,”Jyotirmay”);
printf(“%s”,str);
str=(char*) realloc(str,22);
strcat(str,”Janmayjay”);
printf(“%s”,str);
}

Q35. main( )
{ static char *arr[ ]={ “sanjay”, “balou” , ”Janmay” , ”Jyotir” };
static char **ptr[ ]={ arr+3, arr+2, arr+1, arr};
char ***p=ptr;
**p++;
printf(“%s”,**p);
printf(“%s”,*--*++p);
printf(“%s”,*p[-2]+3);
printf(“%s”,p[-1][-1]+1);
}

Q36. What will be output if you will compile and execute the following c code?
void main()
{ int i=320;
char *ptr=(char *)&i;
printf("%d",*ptr);
}
(a) 320 (b) 1 (c) 64 (d) Compilation error

Q37. What will be output if you will compile and execute the following c code?
void main()
{ int array[]={10,20,30,40};
printf("%d",-2[array]);
}
(a) 60 (b) -30 (c) 60 (d) Garbage value (e) Compilation error

Q38. int main()
{ char str[] = "Programming";
printf("%s ",&str[2]);
printf("%s ",str);
printf("%s ",&str);
}

Q39. What will be output if you will compile and execute the following c code?
void main()
{ int i;
float a=5.2;
char *ptr;
ptr=(char *)&a;
for(i=0;i<=3;i++)
printf("%d ",*ptr++);
}
(a)0 0 0 0 (b)Garbage Garbage Garbage Garbage (c)102 56 -80 32 (d**)102 102 -90 64

Q40. What will be output if you will compile and execute the following c code?
void main()
{
printf("%s","c" "question" "bank");
}
(a) c question bank (b) c (c) bank (**d) cquestionbank (e) Compiler error

Q41. What will be the output of the following program
main( )
{ char a[ ]=”hello”, b[ ]=”hello”;
if(a==b)
printf(“String matched “);
else
printf(“String not matched”);
}

Q42. main( )
{
printf(“%c”, “abcde”[2]);
printf)”%c”,”abcde”+1)[2]);
}

Q43. main( )
{ printf(“%s”, &“abcde”[2]);
printf(”%s”,&”abcde”+1)[2]);
}

Q44. main()
{
static int a[3]={10,20,30},**c,****d;
int *b[]={a,a+1,a+2,a+3,a+4};
c=b;
d=&c;
++*++*c;
printf("%d %d %d",a[0],a[1],a[2]);
}

Q45 main()
{
static int a[3]={10,20,30},***d;
static int *b[]={a,a+1,a+2};
static int **c[]={b,b+1,b+2};
d=c;
++*++*++*d;
printf("%d %d %d",a[0],a[1],a[2]);
}

Q46. main( )
{
if(strcmp(&“abc”,&”abc”))
printf(“matched”);
else
printf(“not matched”);
}
(a) matched (b) not matched (c) no output (d) compilation error

Q47. main( )
{
if(strncmpi(“ramesh”,”RAMNARESH”,3))
printf(“matched”);
else
printf(“not matched”);
}
(a) matched (b) not matched (c) no output (d) compilation error

Q48. What will the output?
main( )
{
int array[ ] = {1, 2, 3, 5, 8, 13, 21, 34, 55};
int sum = 0,i;
for (i = 0; i < 4; i++)
sum += array[array[i]];
printf(“%d”,sum);
}

Q49. What will the output?
main()
{
char *p = NULL;
char *q = 0;
if (p)
printf(" p ");
else
printf("nullp");
if (q)
printf("qn");
else
printf(" nullqn");
}

Q50. int main()
{
int ary[4] = {1, 2, 3, 4};
int *p = ary + 3;
printf("%d %dn", p[-2], ary[*p]);
}

Q51. void main()
{
char a[10][5] = {"hi", "hello", "fellows"};
printf("%d", sizeof(a[1]));
}

Q52. What will be output of following program?
int main(){
char *ptr1 = NULL;
char *ptr2 = 0;
strcpy(ptr1," c");
strcpy(ptr2,"questions");
printf("n%s %s",ptr1,ptr2);
return 0;
}
(a) c question (b) c (null) (c) (null) (null) (d) Compilation error (e) none of these

Q53.
What will be output of following program?
int main(){
int a = 10;
void *p = &a;
int *ptr = p;
printf("%u",*ptr);
return 0;
}
(a) 10 (b) address (c) 2 (d) Compilation error

Q54. What will be output of following program?
int main( )
{
int a,b,c,d;
char *p = ( char *)0;
int *q = ( int *q)0;
float *r = ( float *)0;
double *s = 0;
a = (int)(p+1);
b = (int)(q+1);
c = (int)(r+1);
d = (int)(s+1);
printf("%d %d %d %d",a,b,c,d);
return 0;
}
(a) 2 2 2 2 (b) 1 2 4 8 (c) 1 2 2 4 (d) compilation error

Q55.What will be output of following program?
int main()
{
int a = 5,b = 10,c;
int *p = &a,*q = &b;
c = p - q;
printf("%d" , c);
return 0;
}
(a) 1 (b) 5 (c) -5 (d) Error (e) None of these

Q56. What will be output if you will compile and execute the following c code?
int main()
{
int a[2][4]={3,6,9,12,15,18,21,24};
printf("%d %d %d",*(a[1]+2),*(*(a+1)+2),2[1[a]]);
return 0;
}
(a) 15 18 21 (b) 21 21 21 (c) 24 24 24 (d) Error (e) None of these

Q57. What will be output if you will compile and execute the following c code?
int main()
{
char arr[]="C Question Bank";
char *p;
p+=3;
p=arr;
p+=3;
*p=100;
printf("%s",arr);
return 0;
}
(a) C question Bank (b) C quesdion Bank (c) C qdestion Bank (d) C q100estion Bank

Q58. What will be output the following c code?
int main()
{
int i;
char *arr[4] = {"C","C++","Java","VBA"};
char *(*ptr)[4] = &arr;
for(i=0;i<4;i++)
printf("Address of String %d : %un",i+1,(*ptr)[i]);
return 0;
}

Q59. What will be output the following c code?
int main()
{
int i;
char *arr[4] = {"C","C++","Java","VBA"};
char *(*ptr)[4] = &arr;
for(i=0;i<4;i++)
printf("String %d : %sn",i+1,(*ptr)[i]);
return 0;
}

Q60. What will be output the following c code?
int main()
{
int i;
char *arr[4] = {"C","C++","Java","VBA"};
char *(*ptr)[4] = &arr;
printf("%s",++(*ptr)[2]);
return 0;
}

Asked In C Anshul jain (9 years ago)
Unsolved Read Solution (4)
Is this Puzzle helpful?   (2)   (0) Submit Your Solution Arrays

(#M40152711) C QUESTION try it Keep an EYE Keep an eye puzzle Keep an eye puzzle

class bool test
{
public static void main(string[]args)
{
int result=0;
Boolean b1=new Boolean("true");
Boolean b2=new Boolean("true");
if(b1 equals(b2))
result=result+1000;
system.out.println("result="+result);
}
}


what will be output of this code...
a) result=0
b) result=1000
c) result=2000
d) none

Asked In C Sayali Hatyarkar (10 years ago)
Unsolved Read Solution (9)
Is this Puzzle helpful?   (3)   (1) Submit Your Solution Output

(#M40155285) C QUESTION bitwise Keep an EYE Keep an eye puzzle Keep an eye puzzle

#include

int main()
{
printf("%d %dn", 32<0);
printf("%d %dn", 32>>-1, 32>>-0);
return 0;
}

Asked In C Anshul jain (9 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (5)   (1) Submit Your Solution
Keep an EYE (0)
Solved Question (6) UnSolved Question (454)
Pages: 46FirstPrev13141516171819202122NextLast
  • Login
  • Register

Resend

Sponsored Links

Advertisements

Challenger of the Day

no image
Dimple
India
Punjab
Time: 00:01:33
Points
19

Maths Quotes

Mathematics is a game played according to certain simple rules with meaningless marks on paper.

David Hilbert

"There is nothing called attitude, its just the presence or absence of courage"

Sandeep Upadhyay

Placed User Comments

M4Math helped me a lot.

Vipul Chavan 5 years ago

Thanks m4 maths for helping to get placed in several companies.
I must recommend this website for placement preparations.

yash mittal 5 years ago

Now enjoy Offline Access of latest Question.

Get M4maths app to avail expert's solution and latest selected questions.

Download m4maths app now

  • 2533K+Registerd user
  • 1774K+Engineers
  • 759K+MBA Asprirant
  • 3K+Enginnering College
  • 250+Company Exam
  • 150K+Interview Questions
  • Site Links
  • Home
  • Result
  • Today's Puzzle
  • Discussion Board
  • Maths Tricks
  • Advertise with us
  • Contact Us
  • Useful Info
  • Maths Quotes
  • Previous Puzzles
  • Prize
  • Privacy Policy
  • Disclaimer and Copyright
  • Terms and Conditions
  • Sitemap
  • Placement papers
  • TCS Placement Paper
  • HCL Placement Paper
  • INFOSYS Placement Paper
  • IBM Placement Paper
  • SYNTEL Placement Paper
  • TECHNICAL Interview
  • HR Interview
All rights are reserved to @m4maths.com