Function Argument Variables In C Programming Job Interview Question and Answers

1. What is the purpose of main() function?
Answer:-main() is the user-defined function. main() is the first function in the program, which gets called when the program executes. The startup code contains runmain() function, which calls main() function, we can't change the name of the main() function.

Function Programming In C
Programming Twenty Interview Questions
C Viva Questions for Engineering Freshers
Function And Pointers

2. What is an argument? Differentiate between formal arguments and actual arguments?
Answer:-The actual arguments are the arguments with which the function can be called. The formal arguments are the arguments with which the function can be defined. In simple words, function call contains actual arguments and function definition contains formal arguments.



3. What is the difference between character array and string in C?
Answer:-The major difference between the char array and the string is that the array will not end with the null, whereas string ends with the null.

4. Is it possible to print colors with printf statements?
Answer:-Yes, there are already ready made functions in header file conio.h
textcolor(5) will change the color to the pink. Similarly by changing the value we get different colors.
5. What is the type of the variable b in the following declaration?
#define FLOATPTR float*
FLOATPTR a, b;

a) float
b) float pointer
c) int
d) int pointer
Answer:-float-The statement FLOATPTR a,b; becomes float* a,b; Here "a" is a float pointer, but "b" is just an float variable, so the correct type for "b" is "float", and not "float-pointer". The above problem demonstrate the drawback of using #define constant. To avoid this situation use typedef's in place of #define.

6. How can you determine the maximum value that a numeric variable can hold?
Answer:-The correct way is to include <limits.h> and use the defined macros such as INT_MIN and INT_MAX, which define the minimum and maximum values, which the type can hold.In terms of designing your code, it helps to know that C imposes "minimum maximums" - e.g. a signed char must be able to hold _at least_ the values -127 to 127; a signed int must be able to hold _at least_ the values -32767 to 32767 and so forth.Be wary of assuming that because a type is N bits wide, it can store 2N-1 possible values; there is absolutely no guarantee this is true.
7. Why C is not platform dependent?
Answer:-Let us take example of Linux and Windows to explain this.
We say that C is platform dependent because
1. If you compile and build a C program code in windows, copy that .exe file to a Linux machine, that .exe file will not run there.
2. In the same way if you compile the same program code on Linux, you'll get a .out file which will not run on windows if directly copied there.

8. What is the maximum length of command line arguments including space between adjacent arguments?
Answer:- The C language standard does not impose any maximum on command line length / number of command-line arguments (not that I could find after a cursory search, anyway); the command-line shell is usually the limiting factor in this sort of thing.

9. Which one is correct answer?
  1. C is a low level language
  2. C is a middle level language
  3. C is a high level language
Answer:- C is a middle level language. As C language contains both the features of high-level language and low-level languages. C can also be called as structured programming language.

10. Is it possible to write a C program without semicolons?
Answer:-
// Program For Finding Squar Of A NUmber
 #define Squar(x) (x*x)
void main()
{
while (!printf("Squar Of 2 Is %d", Squar(2))) {
}
}

Related

Programming - C Viva Questions for Engineering Freshers Basics Tutorials

1.) Which among the following is odd one out? a.) printf b.) fprintf c.) putchar d.) scanf ANSWER: d.) scanf 2.) For a typical program, the input is taken using. a.) scanf b.) Files c.) Comma...

Embedded C Programming Twenty Interview Questions Basics Viva Tutorials

1.) Trace the output of the code #include  void foo(int*); int main() { int i = 10; foo((&i)++); } void foo(int *p) { printf(""%d\n"", *p); }  a.) 10 b.) Some garbage val...

C Programming Interview Questions Basics Viva Tutorials

1.) If every node u in G is adjacent to every other node v in G, A graph is said to be a.) isolated b.) complete c.) finite d.) strongly connected ANSWER: b.) complete 2.) In a Heap tree a.) V...

Post a Comment

  1. You have done very good job by creating collection for programming related Q&A.It will really help college going students and their Teachers alike.

    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