C Language interview questions-Coding Tag

Page 1

C Language Interview Questions BY :- Coding Tag


About Us Coding Tag is the E-learning website covering all tutorials of technical and nontechnical tutorials including advanced programming , web Development,current affairs and Technical interviews.... In Coding tag is an outstanding platform for your Studies and Interview Questions practices as well on :AI NLP AGILE HTML CSS PHP SQL C C++ OOPS Ajax JS Python etc... 2


Can one function call another ? Yes, any function can call another function . For example:-

int func1(int x) { return x+1; } int func2(int y) { return func1(func1(y)); } int main(int argc, char* argv[]) { printf("Output is %d\r\n", func2(5)); return 0; }


What is a difference between far and near pointers ? Near pointer : This is a type of pointer which is used to bit address of up to 16 bits in a provided section of the computer memory it can only acces data of a small size of about 64 kb. Far Pointer : This is a type of 32 bit pointer ,it can access information which is outside the computer memory in segments . Huge Pointer: this is a type of 32 bit to that of th faar pointer, it can access bits that are located outside the sector


What are some of the applications of C language ? ● ● ● ● ●

Drivers and utility software Database Operating systems Assembler Text editor and many more


What is a Recursion ? Recursion is a technique in a programming that allows the programmer to express operations In C , this is a form of a function that calls itself many times you wants to repeat the process or any statements. For example recursion may applied to : ● Sorting ● Searching, ● Traversal problems.


C Program to Swap 2 numbers with and without third variable ? Without third variable

With third variable #include<stdio.h> int main() { int var1, var2, temp; scanf("%d%d", &var1, &var2); printf("Before Swapping n First variable = %d n Second variable = %dn", var1, var2); temp = var1; var1 = var2; var2 = temp; printf("After SwappingnFirst variable = %dnSecond variable = %dn", var1, var2); return 0; }

#include<stdio.h> int main() { int a=10, b=20; printf("Before swap a=%d b=%d",a,b); a=a+b;//a=30 (10+20) b=a-b;//b=10 (30-20) a=a-b;//a=20 (30-10) printf("\n After swap a=%d b=%d",a,b); return 0; }


For more Questions on C and C++ to crack your intervie ws Questions at once ...


Than ks!

Any questions? You can find me at

codingtag.com

9


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.