• 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 38

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: 46FirstPrev34353637383940414243NextLast
Advertisements

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

output?
#define f(g,g2) g##g2
main()
{i
nt var12=100;
printf("%d",f(var,12));
}
Answer: 100

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

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

Q.
#include
main()
{i
nt i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}

A. Compiler Error: Constant expression required in function main.

Explanation: The case statement can have only constant expressions (this implies that we
cannot use variable names directly so an error).
Note: Enumerated types can be used in case statements

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

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

output?
Q.
main()
{i
nt i;
printf("%d",scanf("%d",&i)); // value 10 is given as input here
}

A. 1

Explanation: Scanf returns number of items successfully read and not 1/0. Here 10 is given as
input which should have been scanned successfully. So number of items read is 1.

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

(#M40029258) 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. Compiler Error

Explanation: The expression i+++++i is parsed as i ++ ++ + i which is an illegal combination of
operators.

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

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

output?
main()
{i
nt i=1;
while (i2)
goto here;
i++;
}} fun()
{
here:
printf("PP");
}

A. Compiler error: Undefined label 'here' in function main

Explanation: Labels have functions scope, in other words the scope of the labels is limited to functions. The label 'here' is available in function fun() Hence it is not visible in function main

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

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

output??
main()
{
char *p;
p="Hello";
printf("%cn",*&*p);
}

A. H

Explanation: * is a dereference operator & is a reference operator. They can be applied any number of times provided it is meaningful. Here p points to the first character in the string "Hello". *p dereferences it and so its value is H. Again & references it to an address and * dereferences it to the value H.

Asked In C MAN (12 years ago)
Unsolved
Is this Puzzle helpful?   (0)   (2) Submit Your Solution

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

output??
main()
{i
nt i=400,j=300;
printf("%d..%d");
}

A. 400..300

Explanation: printf takes the values of the first two assignments of the program. Any number of printf's may be given. All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values.

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

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

output??
enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}

Answer: 0..1..2

Explanation: enum assigns numbers starting from 0, if not explicitly defined.

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

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

output?
main()
{
clrscr();
}
clrscr();
Answer: No output/error
Explanation: The first clrscr() occurs inside a function. So it becomes a function call. In the
second clrscr(); is a function declaration (because it is not inside any function).

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

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

output?
main()
{
char *p="hai friends",*p1;
p1=p;
while(*p!='') ++*p++;
printf("%s %s",p,p1);
}

Answer. ibj!gsjfoet

Explanation: ++*p++ will be parse in the given order
_ *p that is value at the location currently pointed by p will be taken
_ ++*p the retrieved value will be incremented
_ when; is encountered the location will be incremented that is p++ will be executed Hence, in
the while loop initial value pointed by p is ‘h’, which is changed to ‘i’ by executing ++*p and
pointer moves to point, ‘a’ which is similarly changed to ‘b’ and so on. Similarly blank space is
converted to ‘!’. Thus, we obtain value in p becomes “ibj!gsjfoet” and since p reaches ‘’ and p1
points to p thus p1doesnot print anything

Asked In C MAN (12 years ago)
Unsolved
Is this Puzzle helpful?   (0)   (1) Submit Your Solution
Keep an EYE (0)
Solved Question (6) UnSolved Question (454)
Pages: 46FirstPrev34353637383940414243NextLast
  • Login
  • Register

Resend

Sponsored Links

Advertisements

Challenger of the Day

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

Maths Quotes

Do not worry about your difficulties in mathematics, I assure you that mine are greater.

Albert Einstein

A mathematician is a blind man in a dark room looking for a black cat which isn't there

Charles R. Darwin

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