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

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

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

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

Answer: 45545

Explanation: The arguments in a function call are pushed into the stack from left to right. The evaluation is by popping out from the stack. And the evaluation is from right to left, hence the result.

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

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

output??
#include
main()
{
struct xx
{i
nt x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
}

Answer: Compiler Error

Explanation: You should not initialize variables in declaration

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

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

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

Answer: 77

Explanation: p is pointing to character 'n'. str1 is pointing to character 'a' ++*p. "p is pointing to
'n' and that is incremented by one." the ASCII value of 'n' is 10, which is then incremented to
11. The value of ++*p is 11. ++*str1, str1 is pointing to 'a' that is incremented by 1 and it
becomes 'b'. ASCII value of 'b' is 98.
Now performing (11 + 98 – 32), we get 77("M"); So we get the output 77 :: "M" (Ascii is 77).

output??

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

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

main()
{i
nt c=- -2;
printf("c=%d",c);
}
Answer: c=2;
Explanation: Here unary minus (or negation) operator is used twice. Same maths rules applies,
ie. minus * minus= plus.
Note: However you cannot give like --2. Because -- operator can only be applied to variables as
a decrement operator (eg., i--). 2 is a constant and not a variable

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

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

output??
main()
{
printf("%x",-1

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

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

output??
main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
}
Answer: 1 2
Explanation: The sizeof() operator gives the number of bytes taken by its operand. P is a
character pointer, which needs one byte for storing its value (a character). Hence sizeof(*p)
gives a value of 1. Since it needs two bytes to store the address of the character pointer
sizeof(p) gives 2.

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

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

main()
{i
nt i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}
Answer: 0 0 1 3 1
Explanation: Logical operations always give a result of 1 or 0. And also the logical AND (&&)
operator has higher priority over the logical OR (||) operator. So the expression ‘i++ && j++ &&
k++’ is executed first. The result of this expression is 0 (-1 && -1 && 0 = 0). Now the
expression is 0 || 2 which evaluates to 1 (because OR operator always gives 1 except for ‘0 || 0’
combination- for which it gives 0). So the value of m is 1. The values of other variables are also
incremented by 1.

find output

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

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

main()
{
extern int i;
i=20;
printf("%d",i);
}
Answer: Linker Error : Undefined symbol '_i'
Explanation: extern storage class in the following declaration,
extern int i;
specifies to the compiler that the memory for i is allocated in some other program and that
address will be given to the current program at the time of linking. But linker finds that no other
variable of name i is available in any other program with memory space allocated for it. Hence a
linker error has occurred
find output

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

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

How can I search for data in a linked list?
Unfortunately, the only way to search a linked list is with a linear search, because the only way
a linked list’s members can be accessed is sequentially.
Sometimes it is quicker to take the data from a linked list and store it in a different data
structure so that searches can be more efficient.

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

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

What is the purpose of main( ) function ?
The function main( ) invokes other functions within it.It is the first function to be called when the
program starts execution.
· It is the starting function
· It returns an int value to the environment that called the program
· Recursive call is allowed for main( ) also.
· It is a user-defined function
· Program execution ends when the closing brace of the function main( ) is reached.
· It has two arguments 1)argument count and 2) argument vector (represents strings passed).
· Any user-defined name can also be used as parameters for main( ) instead of argc and argv

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

Resend

Sponsored Links

Advertisements

Challenger of the Day

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

Maths Quotes

"If you able to solve the problems in MATHS, then you also able to solve the problems in your LIFE" (Maths is a great Challenger)

Vignesh

"Full form of MATHS M-mind A-aim T-trick H-habits S-serious "

Ajay Singh

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