C
Top 150 C Interview Questions and Answers 2024
157 questions found
Updated 12 Dec 2024
Q1. Why the default value of reg keyword is garbage value only
The default value of reg keyword is garbage value due to performance optimization.
Garbage value is faster to assign than initializing to a specific value.
Initializing to a specific value would require additional instructions and memory access.
The value of reg keyword is expected to be overwritten before use.
Garbage value can help in detecting uninitialized variables during testing.
Example: int x; // x will have a garbage value until assigned a value.
Q2. Can you tell me the difference between C and C++ ?
C is a procedural programming language while C++ is an extension of C with added features of object-oriented programming.
C is a procedural language, while C++ supports both procedural and object-oriented programming.
C++ has additional features like classes, objects, inheritance, and polymorphism.
C++ supports function overloading and exception handling, which are not present in C.
C++ has a standard template library (STL) that provides useful data structures and algorithms.
C++ ...read more
Q3. Write a short code in java or C
Code to find the factorial of a number
Use a loop to multiply the number with all the numbers below it
Handle the case when the number is 0 or 1 separately
Use long data type to handle large factorials
Q4. Difference between c programming and python
C is a compiled language with low-level memory manipulation, while Python is an interpreted language with high-level abstractions.
C is faster and more efficient for low-level programming, while Python is easier to learn and use for high-level tasks.
C requires manual memory management, while Python has automatic garbage collection.
C is statically typed, while Python is dynamically typed.
C is used for system programming, embedded systems, and game development, while Python is u...read more
Q5. diff b/w c and embedded c
Embedded C is a subset of the C programming language, specifically designed for programming embedded systems.
Embedded C is optimized for resource-constrained systems with limited memory and processing power.
It includes additional keywords and features for controlling hardware directly.
Embedded C often involves working with microcontrollers, sensors, and other hardware components.
Regular C can be used for general-purpose programming on desktop or server systems.
Q6. difference between calloc and malloc function
calloc initializes the allocated memory to zero, while malloc does not.
calloc allocates memory for an array of elements and initializes them to zero, while malloc only allocates memory without initialization.
calloc is useful for initializing arrays of integers or structures, while malloc is more flexible for allocating memory for any data type.
Example: int *arr = (int*)calloc(5, sizeof(int)); // initializes array of 5 integers to zero
Q7. Draw the flow chart for the following C program
Flow chart for a C program
Identify the input and output
Determine the conditions and loops
Draw the flow chart accordingly
Q8. How can we Do Web development using C
Web development using C involves using frameworks like CGI, FastCGI, or libraries like libmicrohttpd.
Use frameworks like CGI or FastCGI to handle HTTP requests and responses.
Utilize libraries like libmicrohttpd for creating web servers in C.
Implement server-side logic in C to generate dynamic web content.
Use HTML and CSS for front-end development alongside C for back-end logic.
C Jobs
Q9. What is c and what is routing
C is a programming language and routing is the process of selecting the best path for network traffic.
C is a high-level programming language used for system programming and developing applications.
Routing is the process of selecting the best path for network traffic to reach its destination.
Routing protocols like OSPF, BGP, and EIGRP are used to determine the best path for network traffic.
Routing tables are used to store information about network topology and available paths....read more
Q10. What is knowledge of c and object oriented language
Knowledge of C and object-oriented languages is essential for software application developers.
C is a procedural programming language commonly used for system programming and embedded systems.
Object-oriented languages like Java, C++, and Python allow for the creation of reusable code through the use of classes and objects.
Understanding concepts like inheritance, polymorphism, and encapsulation is crucial in object-oriented programming.
Proficiency in C and object-oriented langu...read more
Q11. Which compiler we are using in c C data types
The choice of compiler in C depends on the platform and the specific needs of the project.
Different platforms may have different default compilers, such as GCC on Linux and Clang on macOS.
Some projects may require a specific compiler for compatibility or performance reasons.
C compilers include GCC, Clang, Microsoft Visual C++, and Intel C++ Compiler, among others.
Q12. What are the differences between pascal and C?
Pascal is a strongly typed language with built-in data types, while C is a weakly typed language with pointers and manual memory management.
Pascal has built-in data types, while C requires manual declaration and definition of data types
Pascal is strongly typed, while C is weakly typed
C has pointers and manual memory management, while Pascal does not
Pascal has a simpler syntax and is easier to learn, while C is more complex and powerful
C is widely used in systems programming, ...read more
Q13. WHAT IS C AND WHAT DO YOU MEAN BY PROCEDURAL PROGRAMMING LANGUAGES
C is a high-level programming language known for its efficiency and flexibility. Procedural programming languages focus on procedures or routines to execute tasks.
C is a general-purpose programming language developed in the 1970s.
It is widely used for system programming, embedded systems, and applications.
Procedural programming languages like C focus on procedures or routines to execute tasks step by step.
Examples of procedural programming languages include C, Pascal, and For...read more
Q14. C - What does keyword Static do?
The keyword Static is used to declare a variable or method that belongs to the class and not to the instance of the class.
Static variables are shared by all instances of the class.
Static methods can be called without creating an instance of the class.
Static variables and methods are accessed using the class name instead of the instance name.
Static variables are initialized only once, at the start of the program.
Examples of static methods include Math.max() and Arrays.sort().
Q15. Structures in C
Structures in C are user-defined data types that allow for grouping different data types under a single name.
Structures can contain variables of different data types, allowing for more complex data organization.
They are defined using the 'struct' keyword.
Example: struct Person { char name[50]; int age; float salary; };
Individual members of a structure can be accessed using the dot operator (.)
Example: struct Person p1; p1.age = 30;
Q16. Bitwise operations in C
Bitwise operations in C are used to manipulate individual bits of data in variables.
Bitwise AND (&) - sets a bit to 1 only if both corresponding bits are 1
Bitwise OR (|) - sets a bit to 1 if either of the corresponding bits is 1
Bitwise XOR (^) - sets a bit to 1 if the corresponding bits are different
Bitwise NOT (~) - inverts all the bits in a variable
Left shift (<<) - shifts the bits to the left by a specified number of positions
Right shift (>>) - shifts the bits to the right...read more
Q17. Process of gcc compilerfor c files
The gcc compiler processes C files by preprocessing, compiling, assembling, and linking.
Preprocessing: Removes comments, expands macros, and includes header files.
Compiling: Translates source code into assembly code.
Assembling: Converts assembly code into machine code.
Linking: Combines object files and libraries into an executable.
Q18. 1 Wap print even num in python/ C 2 Wap print Fibonacci series num in python
Print even numbers in Python and Fibonacci series in Python.
For printing even numbers in Python, use a loop to iterate through a range of numbers and check if each number is divisible by 2.
For printing Fibonacci series in Python, use a loop to generate the series by adding the previous two numbers in the sequence.
Example for even numbers in Python: for i in range(1, 11): if i % 2 == 0: print(i)
Example for Fibonacci series in Python: a, b = 0, 1 for _ in range(10): print(a) a,...read more
Q19. How are unions used
Unions are used to combine multiple variables of different data types into a single variable.
Unions allow for efficient use of memory by sharing the same memory location for different variables.
They are commonly used in low-level programming for hardware access and data serialization.
An example of a union is a struct that contains a float and an integer, where changing the value of one will affect the other.
Q20. What is Difference between C,C++?
C is a procedural programming language while C++ is an object-oriented programming language.
C is a low-level language while C++ is a high-level language.
C++ supports object-oriented programming concepts like classes, inheritance, and polymorphism.
C++ has better support for exception handling and templates.
C++ is more complex than C and requires more memory.
C++ is used for developing applications like video games, while C is used for developing operating systems and system sof...read more
Q21. Differnence between C and Java
C is a procedural programming language while Java is an object-oriented programming language.
C is a low-level language while Java is a high-level language.
C requires manual memory management while Java has automatic memory management.
C supports pointers while Java does not.
C is platform-dependent while Java is platform-independent.
C has a simpler syntax compared to Java.
Q22. Write a code in python and C
Code snippets in Python and C for System Engineer interview question
Use Python for high-level scripting and C for low-level system programming
Python example: ```python print('Hello, World!') ```
C example: ```c #include
int main() { printf('Hello, World!'); return 0; } ```
Q23. What is embedded c and how is it different from normal c
Embedded C is a variant of C programming language used for programming embedded systems.
Embedded C is used for programming microcontrollers, sensors, and other embedded systems.
It has limited resources and memory, so it requires efficient coding.
It has specific libraries and functions for hardware control.
Normal C is used for general-purpose programming and has no specific hardware dependencies.
Embedded C is compiled using a cross-compiler, while normal C is compiled using a ...read more
Q24. What is calloc ,malloc
calloc and malloc are functions used in C programming to allocate memory dynamically.
calloc is used to allocate and initialize a block of memory, setting all bytes to zero.
malloc is used to allocate a block of memory without initializing its contents.
Both functions return a pointer to the allocated memory, or NULL if the allocation fails.
Q25. C language what is c data types
C data types are used to define the type of data that a variable can hold in C programming language.
C data types include basic types like int, char, float, double, etc.
Derived types like arrays, pointers, structures, and unions are also part of C data types.
Examples: int num = 10; char letter = 'A'; float price = 10.5;
Examples: int arr[5]; int *ptr; struct student { char name[20]; int age; };
Q26. Data structures through c language
Data structures in C language are essential for organizing and manipulating data efficiently.
Data structures like arrays, linked lists, stacks, queues, trees, and graphs are commonly used in C programming.
Arrays are used to store a collection of elements of the same data type.
Linked lists are used to store elements in a linear order.
Stacks and queues are used for storing elements in a last-in-first-out (LIFO) and first-in-first-out (FIFO) manner, respectively.
Trees and graphs...read more
Q27. What is features of the C programming language.
C is a procedural programming language known for its efficiency and low-level memory manipulation capabilities.
C is a compiled language
It has a small set of keywords and operators
It supports pointers and low-level memory manipulation
It has a preprocessor for macro expansion
It has a standard library with functions for common tasks
Examples: printf() for output, scanf() for input, malloc() for memory allocation
Q28. Diffreence between C and c++
C is a procedural programming language while C++ is an extension of C with added features of object-oriented programming.
C is a procedural language, meaning it follows a step-by-step approach to solve a problem.
C++ is an extension of C and supports both procedural and object-oriented programming paradigms.
C++ introduces classes, objects, inheritance, and polymorphism, which are not present in C.
C++ has additional features like exception handling, templates, and namespaces.
C++...read more
Q29. Diff between C and Java?
C is a procedural language while Java is an object-oriented language.
C is compiled while Java is interpreted
C has pointers while Java does not
Java has automatic garbage collection while C does not
Java has platform independence while C does not
Java has built-in exception handling while C does not
Q30. Write a coding in both python & C
Write a coding in both python & C
Use a simple program like printing 'Hello, World!'
Ensure syntax and formatting are correct in both languages
Test the code in both Python and C environments
Q31. Difference between C and Embedded C language
Embedded C is a subset of C language specifically designed for embedded systems programming.
Embedded C is optimized for resource-constrained systems with limited memory and processing power.
Embedded C may have specific compiler directives and keywords for hardware manipulation.
Embedded C may not support all standard C libraries and features.
Example: Using 'volatile' keyword for memory-mapped hardware registers in Embedded C.
Q32. Write a program logic factorial in c programming
Program logic for factorial in C programming
Use a loop to multiply the number with all the numbers less than it
Initialize the result variable with 1
Handle the case when the input is 0 or 1 separately
Q33. 1.Difference between C and Cpp
C is a procedural language while C++ is an object-oriented language.
C does not support classes and objects while C++ does.
C++ supports function overloading while C does not.
C++ has a built-in exception handling mechanism while C does not.
C++ supports namespaces while C does not.
C++ supports references while C does not.
Q34. Rate yourself in C and Java?
I rate myself 8/10 in C and 9/10 in Java.
Strong understanding of data structures and algorithms
Experience in developing applications using both languages
Familiarity with debugging and troubleshooting
Regularly update my knowledge through online resources and courses
Q35. Why is python better than C
Python is better than C due to its simplicity, readability, and versatility.
Python is easier to learn and use compared to C, making it more beginner-friendly.
Python code is more readable and concise, leading to faster development and easier maintenance.
Python has a wide range of libraries and frameworks for various applications, while C is more low-level and requires more manual memory management.
Q36. What is c code in java
C code in Java refers to the use of the Java Native Interface (JNI) to incorporate C code into Java programs.
C code in Java is typically used when performance optimization or low-level system access is required.
JNI allows Java programs to call C functions and use C libraries.
C code can be written separately and compiled into a shared library, which is then loaded and used by Java code.
JNI provides a way to pass data between Java and C, handle exceptions, and manage memory.
Exa...read more
Q37. What is the difference between c and c++
C++ is an extension of C with object-oriented programming features.
C++ supports object-oriented programming while C does not.
C++ has a richer set of libraries compared to C.
C++ allows function overloading while C does not.
C++ supports exception handling while C does not.
C++ has a more complex syntax compared to C.
C++ is backward compatible with C.
C++ has a built-in string class while C does not.
Q38. How would you rate yourself in C and Java?
I would rate myself as proficient in both C and Java.
I have extensive experience in both languages, having worked on multiple projects using them.
I am comfortable with the syntax and can write efficient and optimized code.
I am familiar with the standard libraries and can use them effectively.
I am always learning and improving my skills in both languages.
For example, in C, I have worked on projects involving embedded systems and low-level programming, while in Java, I have dev...read more
Q39. Examples of c python
C Python is a C extension module that allows C code to call Python functions and manipulate Python objects.
Cython is a popular tool for writing C extensions for Python
NumPy is a Python library that provides support for large, multi-dimensional arrays and matrices
Pygame is a set of Python modules designed for writing video games
Scikit-learn is a Python library for machine learning built on top of NumPy and SciPy
Q40. What is Little endian and Big endian in C
Little endian and Big endian are byte ordering formats in which multi-byte data is stored in memory.
Little endian: Least significant byte is stored at the lowest memory address.
Big endian: Most significant byte is stored at the lowest memory address.
Example: In Little endian, the number 0x12345678 is stored as 78 56 34 12 in memory.
Example: In Big endian, the same number is stored as 12 34 56 78 in memory.
Q41. What are the differences in c and c++?
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for function overloading and templates.
C++ has a standard library that includes many useful functions.
C++ allows for both procedural and object-oriented programming.
C++ is generally considered to be more complex than C.
Q42. Difference between Java and C language.
Java is an object-oriented programming language while C is a procedural programming language.
Java is platform-independent while C is platform-dependent.
Java has automatic memory management while C requires manual memory management.
Java has built-in support for multithreading while C requires external libraries for multithreading.
Java has a larger standard library compared to C.
Java is used for developing web applications, mobile applications, and enterprise software while C i...read more
Q43. what are the storage class in c
Storage classes in C define the scope and lifetime of variables.
Auto: default storage class for local variables
Register: stores variables in CPU registers for faster access
Static: retains value between function calls
Extern: allows variables to be accessed across multiple files
Q44. why to c over cpp
C is preferred over C++ for certain applications due to its simplicity and efficiency.
C is a simpler language compared to C++ and has a smaller runtime footprint.
C is often used for low-level programming, embedded systems, and operating systems.
C allows for more control over memory management and can be faster in certain scenarios.
C++ introduces additional features like object-oriented programming and templates, which may not be necessary for all projects.
Q45. What is c language, what is java
C language is a procedural programming language, while Java is an object-oriented programming language.
C language is low-level and provides direct access to memory, making it efficient for system programming.
Java is platform-independent and has a rich set of libraries, making it suitable for developing applications.
C language uses pointers extensively, while Java handles memory management automatically with garbage collection.
C language is widely used for operating systems, e...read more
Q46. What is storage class in C class?
A storage class in C defines the scope and lifetime of variables.
Storage classes include auto, register, static, and extern.
Auto variables are stored in the stack and have local scope.
Register variables are stored in CPU registers for faster access.
Static variables retain their value between function calls.
Extern variables are declared in one file and can be used in another file.
Q47. What is the difference between c and c++
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for function overloading and templates.
C++ has a more complex syntax compared to C.
C++ has a standard library that includes many useful functions.
C++ is generally considered to be a more powerful language than C.
Q48. What is the different between java and c
Java and C are both programming languages, but differ in syntax, usage, and platform compatibility.
Java is an object-oriented language, while C is a procedural language.
Java is platform-independent, while C is platform-dependent.
Java has automatic memory management, while C requires manual memory management.
Java has a larger standard library than C.
C is faster and more efficient than Java for certain tasks, such as system programming.
Java is commonly used for web development,...read more
Q49. what is array in c
An array in C is a collection of elements of the same data type stored in contiguous memory locations.
Arrays are declared by specifying the data type of the elements and the number of elements in square brackets, e.g. int arr[5];
Elements in an array can be accessed using their index, starting from 0, e.g. arr[0] refers to the first element.
Arrays in C are zero-indexed, meaning the first element is at index 0.
Arrays can be of any data type, including arrays of strings like cha...read more
Q50. What is the differnce between c and c++?
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for polymorphism and inheritance.
C++ has a standard template library (STL) for data structures and algorithms.
C++ allows function overloading while C does not.
C++ has exception handling while C does not.
Q51. What is better java or c?
Both Java and C have their own strengths and weaknesses, and the choice depends on the specific requirements of the project.
Java is better for developing enterprise-level applications due to its platform independence and robustness.
C is better for developing system-level software and applications that require high performance and low-level access to hardware.
Java has a larger community and more libraries and frameworks available, making it easier to find solutions to common p...read more
Q52. Give examples of each data types in C
Examples of data types in C include int, float, char, and double.
int: used for storing integer values (e.g. age = 25)
float: used for storing floating-point numbers (e.g. height = 5.8)
char: used for storing single characters (e.g. grade = 'A')
double: used for storing double-precision floating-point numbers (e.g. salary = 50000.50)
Q53. Why is c++ better than C?
C++ is better than C due to its object-oriented programming features and better memory management.
C++ supports object-oriented programming while C does not.
C++ has better memory management with features like constructors and destructors.
C++ has more advanced features like templates and exceptions.
C++ is more versatile and can be used for both low-level system programming and high-level application development.
C++ has a larger standard library compared to C.
C++ allows for func...read more
Q54. Different between c and java
C is a procedural language while Java is an object-oriented language.
C is compiled while Java is interpreted
Java has automatic garbage collection while C requires manual memory management
Java has platform independence while C is platform dependent
Java has built-in exception handling while C does not
Java has a larger standard library than C
Q55. count the number of occurences in program in c .
Use a loop to iterate through the array and count the occurrences of a specific element.
Initialize a counter variable to keep track of the occurrences.
Use a loop to iterate through the array.
Check each element in the array and increment the counter if it matches the specific element.
Return the final count of occurrences.
Q56. Differance between c and c++
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for function overloading and templates.
C++ has a standard library that includes many useful functions.
C++ is more complex than C and can be harder to learn.
C++ code can be compiled as C code with some modifications.
Q57. What is java and difference between java and c
Java is a high-level programming language used for developing applications. Java is platform-independent and object-oriented.
Java is compiled and interpreted while C is only compiled
Java is platform-independent while C is platform-dependent
Java is object-oriented while C is procedural
Java has automatic garbage collection while C does not
Java has a larger standard library compared to C
Q58. Write a C code to swap two numbers without using 3rd variable
Swapping two numbers without using a third variable in C code.
Use bitwise XOR operation to swap two numbers without using a third variable.
Example: int a = 5, b = 10; a = a ^ b; b = a ^ b; a = a ^ b; // Now a = 10, b = 5
Q59. State the differences between C and C++.
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has constructors and destructors while C does not.
C++ supports function overloading while C does not.
C++ has namespaces while C does not.
C++ supports exception handling while C does not.
Q60. what is java and how is it different from c?
Java is a high-level programming language known for its platform independence, while C is a low-level programming language with more direct hardware access.
Java is platform-independent, meaning code can run on any device with a Java Virtual Machine (JVM)
C is a low-level language with more direct hardware access, making it faster but less portable than Java
Java has automatic memory management through garbage collection, while C requires manual memory management
Q61. What is the output of a given C program
The output of a C program depends on the code logic and input provided.
The output can be determined by analyzing the code and understanding the logic implemented.
Input values can also affect the output of the program.
Compile and run the program to see the actual output.
Q62. what is diff b/w c and c++
C++ is an extension of C with added features like object-oriented programming, templates, and exception handling.
C++ supports object-oriented programming while C does not.
C++ has templates for generic programming while C does not.
C++ has exception handling while C does not.
C++ has a standard library that includes the C standard library.
C++ allows function overloading while C does not.
Q63. what is java and c
Java and C are both popular programming languages used for developing software applications.
Java is a high-level, object-oriented programming language known for its platform independence.
C is a procedural programming language known for its efficiency and flexibility.
Java uses a virtual machine to run code, while C directly compiles to machine code.
Java is commonly used for web development, mobile apps, and enterprise applications.
C is often used for system programming, embedd...read more
Q64. What is malloc and calloc function
malloc and calloc are functions in C programming used for dynamic memory allocation.
malloc function is used to allocate a single block of memory of a specified size.
calloc function is used to allocate multiple blocks of memory of a specified size, initialized to zero.
Example: int *ptr = (int*)malloc(5 * sizeof(int));
Example: int *ptr = (int*)calloc(5, sizeof(int));
Q65. What is c,what is cpp and so on.
C and C++ are programming languages used for system programming and application development.
C is a procedural programming language developed by Dennis Ritchie in 1972.
C++ is an object-oriented programming language developed by Bjarne Stroustrup in 1983.
C is used for system programming, embedded systems, and operating systems.
C++ is used for application development, game development, and system programming.
C++ is an extension of C with additional features like classes, inherit...read more
Q66. Whay is different between c and java
C is a procedural programming language while Java is an object-oriented programming language.
C is a procedural programming language, focusing on functions and procedures.
Java is an object-oriented programming language, focusing on classes and objects.
C requires manual memory management, while Java has automatic garbage collection.
C is platform-dependent, while Java is platform-independent due to its bytecode compilation.
C supports pointers, while Java does not.
C has a simpler...read more
Q67. what is struct and unions
Structs and unions are data structures in C programming used to group different data types under a single name.
Structs allow you to group different data types together under a single name. For example, a struct 'Person' can have fields like name, age, and gender.
Unions are similar to structs but they share the same memory location for all its members. Only one member can contain a value at a time. For example, a union 'Data' can have fields like int, float, and char, but only...read more
Q68. What is c? What is c++?
C and C++ are programming languages used for system and application software development.
C is a procedural programming language developed by Dennis Ritchie in 1972.
C++ is an object-oriented programming language developed by Bjarne Stroustrup in 1983.
C is used for developing system software, device drivers, and embedded systems.
C++ is used for developing application software, games, and operating systems.
C++ is an extension of C with additional features like classes, inheritan...read more
Q69. What is difference between Java and C, explain features of java
Java is a high-level programming language, while C is a low-level language. Java is platform-independent and has automatic memory management.
Java is an object-oriented language, while C is a procedural language.
Java uses a virtual machine (JVM) for execution, while C directly compiles to machine code.
Java has built-in garbage collection, while C requires manual memory management.
Java supports multithreading and exception handling, while C has limited support for these feature...read more
Q70. stack variable is present in which segment
Stack variable is present in the stack segment of memory.
Stack variables are local variables declared inside a function and are stored in the stack segment of memory.
Stack memory is used for function calls and local variables, and is managed in a Last In First Out (LIFO) manner.
Example: int x; is a stack variable declared inside a function.
Q71. Differences between C and C++
C is a procedural programming language while C++ is an extension of C with object-oriented programming features.
C is a procedural language while C++ supports both procedural and object-oriented programming.
C does not have built-in support for classes and objects, while C++ does.
C++ supports features like inheritance, polymorphism, and encapsulation which are not available in C.
C++ has a standard template library (STL) which provides useful data structures and algorithms.
C++ a...read more
Q72. what is c and java
C and Java are both programming languages commonly used for software development.
C is a procedural programming language developed by Dennis Ritchie in 1972.
Java is an object-oriented programming language developed by Sun Microsystems in 1995.
C is often used for system programming and low-level programming.
Java is platform-independent and commonly used for web development.
C requires manual memory management, while Java has automatic garbage collection.
Q73. What are data types in c language
Data types in C language define the type of data that a variable can store.
Basic data types include int, float, char, double, etc.
Derived data types include arrays, pointers, structures, unions, etc.
Example: int num = 10; char letter = 'A'; float value = 3.14;
Q74. What is c language and c++ language deference
C is a procedural programming language while C++ is an object-oriented programming language.
C is a low-level language while C++ is a high-level language.
C does not support classes and objects while C++ does.
C++ supports function overloading and operator overloading while C does not.
C++ has better support for exception handling than C.
C++ is an extension of C language.
Q75. What are your skills? C language and java
Proficient in C language and Java programming with experience in developing software applications.
Strong understanding of data structures and algorithms in C language
Experience in developing web applications using Java
Knowledge of object-oriented programming principles in Java
Familiarity with Java frameworks like Spring and Hibernate
Q76. Explain storage variables in C?
Storage variables in C are used to store data temporarily during program execution.
Storage variables in C are declared using data types like int, float, char, etc.
They can be stored in different memory locations like stack, heap, or data segment.
Variables declared outside functions have global scope and are stored in data segment.
Variables declared inside functions have local scope and are stored in stack memory.
Dynamic memory allocation using functions like malloc() stores v...read more
Q77. diff bt c and c++? ---told
C is a procedural programming language while C++ is an extension of C with added features of object-oriented programming.
C is a procedural language, meaning it follows a step-by-step approach to solve a problem.
C++ is an extension of C and supports both procedural and object-oriented programming paradigms.
C++ introduces features like classes, objects, inheritance, and polymorphism that are not present in C.
C++ allows for the use of libraries and frameworks developed in C, mak...read more
Q78. What is the difference of c and java?
C is a procedural programming language while Java is an object-oriented programming language.
C is a low-level language, closer to the hardware, while Java is a high-level language.
C requires manual memory management, while Java has automatic garbage collection.
C is platform-dependent, while Java is platform-independent due to its bytecode.
C uses pointers extensively, while Java does not have pointers.
C is used for system programming, embedded systems, etc., while Java is used...read more
Q79. Why C is called middle level language?
C is called middle level language because it combines features of both high-level and low-level languages.
C allows low-level manipulation like memory management and bit manipulation.
C also supports high-level features like functions, data structures, and dynamic memory allocation.
C is closer to the hardware compared to high-level languages like Java or Python, but not as close as low-level languages like assembly.
C provides a good balance between performance and flexibility.
Q80. What is tha different between cand c++
C++ is an extension of C language with object-oriented programming features.
C++ supports object-oriented programming while C does not.
C++ has more advanced features like templates, exceptions, and namespaces.
C++ is more complex and harder to learn than C.
C++ is used for developing system software, games, and applications.
C is used for developing operating systems, embedded systems, and device drivers.
Q81. What is c? Difference between C and Java?
C is a procedural programming language. C is faster and more efficient than Java.
C is a low-level language, closer to machine code.
C requires manual memory management, while Java has automatic garbage collection.
C is used for system programming, embedded systems, and operating systems.
Java is used for web development, mobile app development, and enterprise applications.
Q82. What are storage classes in c language?
Storage classes in C language define the scope and lifetime of variables.
There are four storage classes in C: auto, register, static, and extern.
Auto variables are local to the block they are declared in and have automatic storage duration.
Register variables are stored in CPU registers for faster access.
Static variables retain their value between function calls.
Extern variables are declared outside of any function and can be accessed by other files.
Example: int x; // auto sto...read more
Q83. Write C code and C++ code
Providing C and C++ code for Senior Software Engineer position
For C code, demonstrate knowledge of pointers, memory allocation, and basic data structures
For C++ code, showcase understanding of object-oriented programming, inheritance, and polymorphism
Provide clear and concise code with proper commenting and formatting
Q84. Languages known( c, java)
I am proficient in C and Java programming languages.
Experience in developing applications using C and Java
Knowledge of data structures and algorithms
Familiarity with object-oriented programming concepts
Ability to write efficient and optimized code
Examples: Developed a Java-based web application for online shopping, Implemented a C program for sorting algorithms
Q85. Explain about the structures in c
Structures in C are user-defined data types that allow grouping of variables of different data types under a single name.
Structures are used to represent a record which consists of different data types.
They are defined using the 'struct' keyword.
Each variable in a structure is called a member.
Structures can be nested within other structures.
Example: struct employee { int emp_id; char emp_name[50]; float emp_salary; };
Example: struct point { int x; int y; };
Q86. Difference b/w c and c++
C is a procedural programming language while C++ is an object-oriented programming language.
C++ supports classes and objects while C does not.
C++ has better support for polymorphism and inheritance than C.
C++ has a larger standard library than C.
C++ allows function overloading while C does not.
C++ supports exception handling while C does not.
Q87. C and Java difference
C is a procedural language while Java is an object-oriented language.
C is compiled while Java is interpreted.
C has pointers while Java does not.
Java has automatic garbage collection while C does not.
Java has a built-in exception handling mechanism while C does not.
Java has a larger standard library than C.
C is used for system programming while Java is used for web and mobile applications.
Q88. write to print string by passing char*
Use a loop to print each character of the string passed as a char* parameter.
Use a for loop to iterate through each character of the char* parameter.
Print each character using printf or cout.
Ensure to handle the null terminator at the end of the string.
Q89. 1.Different between c and c++
C++ is an extension of C with added features like object-oriented programming, templates, and exception handling.
C++ supports object-oriented programming while C does not.
C++ has a richer set of data types and operators than C.
C++ supports function overloading and templates while C does not.
C++ has exception handling while C does not.
C++ is backward compatible with C.
Example: C++ allows defining classes and objects while C does not.
Example: C++ supports function overloading, ...read more
Q90. tell me about functions in c
Functions in C are blocks of code that perform a specific task and can be called multiple times within a program.
Functions in C are defined using a return type, function name, parameters, and a body enclosed in curly braces.
Functions can be called multiple times within a program to perform the same task without rewriting the code.
Functions can return a value using the 'return' statement.
Functions can also be void, meaning they do not return a value.
Example: int add(int a, int...read more
Q91. Explain about c and c++
C and C++ are programming languages used for system programming and application development.
C is a procedural language while C++ is an object-oriented language.
C is used for system programming, embedded systems, and low-level programming.
C++ is used for application development, game development, and high-performance computing.
C++ supports features like inheritance, polymorphism, and encapsulation.
Both languages are compiled languages and have a similar syntax.
Q92. What is Pointer
A pointer is a variable that stores the memory address of another variable.
Pointers are used to access and manipulate memory directly.
They are commonly used in programming languages like C and C++.
Example: int *ptr; // declares a pointer to an integer variable
Q93. what is c c++
C and C++ are programming languages used for system and application software development.
C is a procedural programming language developed by Dennis Ritchie in 1972.
C++ is an object-oriented programming language developed by Bjarne Stroustrup in 1983.
Both languages are widely used for developing operating systems, device drivers, and other system software.
C++ is also used for developing applications, games, and other software.
C++ is an extension of C and includes additional fe...read more
Q94. Copy one string to another without using any standard function
Use a loop to copy characters from one string to another
Create two character arrays to store the strings
Use a loop to iterate through each character of the source string and copy it to the destination string
Add a null terminator at the end of the destination string to mark the end of the copied string
Q95. What is c++ What is c
C++ and C are programming languages used for system and application development.
C++ is an object-oriented language that supports polymorphism, inheritance, and encapsulation.
C is a procedural language that is widely used for system programming and embedded systems.
Both languages are compiled and have a wide range of applications in software development.
C++ is often used for developing applications, games, and operating systems.
C is often used for developing system software, d...read more
Q96. write to print string in C style array
Use a loop to print each character of the string in C style array format
Declare an array of characters with the string length + 1 for null terminator
Use a loop to copy each character of the string into the array
Add a null terminator at the end of the array to signify the end of the string
Q97. Difference between C programming and C++
C++ is an extension of C programming language with added features like object-oriented programming and templates.
C++ supports object-oriented programming while C does not.
C++ has a richer set of libraries compared to C.
C++ supports function overloading while C does not.
C++ supports exception handling while C does not.
C++ supports templates while C does not.
C++ has a more complex syntax compared to C.
C++ is backward compatible with C.
C++ is used for developing operating system...read more
Q98. Detect endianness using C program
Detect endianness using C program
Use a union to create a variable with a known value
Check the value of the first byte to determine endianness
Big endian systems store the most significant byte first
Little endian systems store the least significant byte first
Example: union { int i; char c; } u; u.i = 1; if (u.c == 1) { /* Little endian */ } else { /* Big endian */ }
Q99. 1)Difference between C and C++
C is a procedural programming language while C++ is an extension of C with added features of object-oriented programming.
C is a procedural language, while C++ supports both procedural and object-oriented programming.
C does not have built-in support for classes and objects, while C++ does.
C++ supports features like inheritance, polymorphism, and encapsulation, which are not present in C.
C++ has a standard template library (STL) that provides useful data structures and algorith...read more
Q100. Explain about structures in c
Structures in C are user-defined data types that allow you to group different variables under a single name.
Structures are used to represent a record.
They can contain variables of different data types.
You can access the members of a structure using the dot operator.
Structures are defined using the 'struct' keyword.
Top Interview Questions for Related Skills
Interview Questions of C Related Designations
Interview experiences of popular companies
Reviews
Interviews
Salaries
Users/Month