Embedded C Basic Questions for Job Interview and Lab Examination (Viva Tips) Part - I

Q. What does the keyword const mean? What do the following declarations mean?

const int a;
int const a;
const int *a;
int * const a;
int const * a const;

The first two mean the same thing, namely a is a const (read-only) integer.

The third means a is a pointer to a const integer (that is, the integer isn’t modifiable, but the pointer is).

The fourth declares a to be a const pointer to an integer (that is, the integer pointed to by a is modifiable,but the pointer is not).

The final declaration declares a to be a const pointer to a const integer
(that is, neither the integer pointed to by a, nor the pointer itself may be modified).
-------------------------------------------------- 


Q. Can a parameter be both const and volatile ? Explain.
Yes. An example is a read-only status register. It is volatile because it can change unexpectedly. It is const because the program should not attempt to modify it
-------------------------------------------------- 


Q.Can a pointer be volatile ? Explain.

Yes, although this is not very common. An example is when an interrupt service routine modifies a pointer to a buffer
--------------------------------------------------
Q. Why is sizeof(‘a’) not 1?Perhaps surprisingly, character constants in C are of type int, so sizeof(‘a’) is sizeof(int) (though it’s different in C++). 


Result:
In Turbo C output is: 2
In Turbo C++ output is: 1
-------------------------------------------------- 

Q. why n++ executes faster than n+1?

The expression n++ requires a single machine instruction such as INR to carry out the increment operation whereas, n+1 requires more instructions to carry out this operation.




More Embedded C Programming Questions And Suitable Answers:

Difference Between Process and Thread

What happens When Interrupt Occurs
Differences between Mutex And Semaphore
Unions-Why And When To Use
What is Storage class
C Programming Questions for Job Interview
Embedded C Programming Basic Questions for Job Interview
Data Declarations And qualifiers
Variables and Pointers Volatile Or Costant
Dangling and Wild Pointers

Related

Interview Questions Loop C Programming For Enginnering Students Basics Viva Tutorials

1.Which is the correct statement? a) Printf(“Maximum = %d\n”, (x.y) ? x : y); b) Printf( “%s\n”, (mark >= 60) ? “First class” : “Not first class” ); c) Printf(“%s\n”, PASS); d) All of the above ...

Structures And Unions C Programming Interview Questions- Basics Viva Tutorials

1.A bit field is a) A pointer variable in a structure. b) One bit or a set of adjacent bits within a word c) A pointer variable in a union d) Not used in C ANSWER: B 2.Union differs from structure...

Placement Questions C Operators Viva Interview for Engineering Freshers Basics Tutorials

1.Which of the following is not a compound assignment operator? a) /= b) += c) %= d) ==  ANSWER: d) == 2.What will be the output of the following code snippet? Y = 5; if (! Y > 10) X = Y + 3; e...

Post a Comment

  1. Thanks Kix for Your comment.We believe in healthy back-links so we moderate comments.

    ReplyDelete

SPAMMING will not be Appreciated.

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

Hot in weekRecentComments

Hot in week

Recent

C Programming - Data Structure Interview Questions Answer

We have started series of C programming Q&A for job interview for freshers.Computer / IT Engineering Professionals and Students alike will be benefited.We recommend our user to go through pre...

C Programming Question Answer

We have started series of C programming Q&A for job interview candidates.Engineering Professionals and students alike will be benefited.We recommend our user to go through previous post to enha...

Java Objective Multiple Answer Questions Bank

We have chosen Java Oracle J2EE, J2SE, Net-beans, JVM ( Java Virtual Machine ) as our readers choice.We have created Objective Type Multiple Answer Question Collection that are frequent in job inte...

Java Question Bank Objective Q&A

Here we have collected frequently asked question in job interviews.We have chosen Java as our readers choice.You will find these helpful.We encourage our Readers to send in their suggestion. If re...

C Question Bank

We have started series of C programming Question bank for job interview candidates.Engineering Professionals and students alike will be benefited.We encourage our readers to provide feedback and as...

Comments

Anonymous:

Technology is always being the vital part of evolution either mobile phones or computer all are the part of it. Electronics have made things so easy and reliable for human being s. very few schools in...

Anonymous:

A detailed and complete knowledge guide for fresher's to crack their interviews in Embedded Programming. Looking for a job contact <a href="http:/celebratejobs.com/>celebratejobs</a&...

YouLoseBellyFat:

visual basic example codes

App Development Mumbai:

It was very useful for me. Keep sharing such ideas in the future as well. This was actually what I was looking for, and I am glad to came here! Thanks for sharing the such information with us.

Anonymous:

Thanks for Appreciations.We love to hear again from you.

Our Channel

Contact Us

Name

Email *

Message *

item