23 IT Interview Questions & Answers for Freshers

Here I am providing some question and there answers which will help you to get job in IT Company .

23 IT Interview Questions & Answers for Freshers


❝ Here I am providing some question and there answers which will help you to get job in IT Company. Question are related to only C programming ❞

 

C programming questions for freshers

1.what is C programming and why we use it?  

☛ C is High level language. 
☛ It is developed by Dennis Ritchie in 1970's  at At &T Bell Labs. 
☛ It is used to Develop system Software and application  . 

2. Why we use main ( ) Function in every C program? 

☛ Main is pre declared and user defined function.
☛ it is compulsory to use this function in every C program because execution
of the program begins with main ( ) .

3. What is meaning of header file? 

☛ Header file Contains Declarations of pre -defined function. 
☛ We can use any number of header file in our  programs as per requirement
 of pre defined functions. 

4. Name some Header File? 

☛ some header files are :-
  • STDIO. H
  • COINING. H.
  • MATH. H
  • STDLIB. H
  • STRING. H
  • GRAPHICS. H

5. What is meaning of #include ? 

☛ It is processor Directive. It is used to Include any header file in our program. 

6. Why We use VOID keyword before main ( ) ? 
☛ Void is a data type. 
☛ If We are using void then it gives instruction to  Compiler  that main ( ) function 
will not return any  value. 

7. What is difference between  < STDIO. H>  and < CONIO. H> header files? 

☛ STDIO. H contains Declarations of print f ( ) and Scan f ( ) . 
☛  CONIO. H Contains Declarations of Clrscr ( ) 
Gtech ( ) . 

8. What is print f ( ) ? 

☛ Print F ( ) is a pre defined function. It is declared in STDIO. H
☛ This function is used to print some text on console. 

9. What is Scan F ( ) ? 

☛ Scan F ( ) is a pre defined function. It is declared in STDIO. H
☛ This is used to read some values from console. 

10. What is Console . 

☛ In simple terms Console is known as output screen through which user interacts with the source Code. 

11. What are the modifiers available in C programming language?

Ans :  There are 5 modifiers available in the C programming language as follows:
  • Short
  • Long
  • Signed
  • Unsigned
  • long long
12. What is the main  difference between Call by Value and Call by Reference?

Ans :  When using Call by Value, you are sending the value of a variable as parameter to a function, whereas Call by Reference sends the address of the variable. And, under Call by Value, the value in the parameter is not affected by whatever operation that takes place, while in the case of Call by Reference, values can be affected by the process within the function


13. How do you generate random numbers in C?

Ans :  In simple terms Random numbers are generated in C using the rand() command. For example: anyNum = rand() will generate any integer number beginning from 0, assuming that anyNum is a variable of type integer.


14. What are comments and how do you insert it in a C program?

Ans : In simple terms Comments are a great way to put some remarks or description in a program. It is used  as a reminder on what the program is all about, or a description on why a certain code or function was placed there in the first place. Comments begin with /* and ended by */ characters. Comments can be a single line, or can even span several lines. It can be placed anywhere in the program

15. What are reserved words?

Ans : In simple terms Reserved words are words that are part of the standard C language library. This means that reserved words have special meaning and therefore cannot be used for purposes other than what it is originally intended for. Examples of reserved words are int, void, and return.

16. What are linked list?

Ans : 
In simple terms A linked list is composed of nodes that are connected with another. In C programming, linked lists are created using pointers. Using linked lists is one efficient way of utilizing memory for storage.

17. What is FIFO?

Ans : In simple terms  In C programming, there is a data structure known as queue. In this structure, data is stored and accessed using FIFO format, or First-In-First-Out. A queue represents a line wherein the first data that was stored will be the first one that is accessible as well.

18. What are the different data types in C?

Ans :   

In simple terms The basic data types are int, char, and float. Int is used to declare variables that will be storing integer values. Float is used to store real numbers. Char can store individual character values.

19. What are pointers?


Ans :   In simple terms Pointers point to specific areas in the memory. Pointers contain the address of a variable, which in turn may contain a value or even an address to another memory.

20. What is the purpose of printf() and scanf() in C Program?

Ans:  
In simple terms  printf() is used to print the values on the screen. To print certain values, and on the other hand, scanf() is used to scan the values. We need an appropriate datatype format specifier for both printing and scanning purpose.


21 .Writing “Hello, World!” program. in C .

#include <stdio.h>

 int main() {
      // printf() displays the string inside quotation
      printf("Hello, World!"); 
return 0; }


Output

Hello, World!


22 .C Program to swap two numbers .


#include <stdio.h>
 
int main()
{
    int x, y;
    printf("Enter Value of x ");
    scanf("%d", &x);
    printf("\nEnter Value of y ");
    scanf("%d", &y);
 
    int temp = x;
    x = y;
    y = temp;
 
    printf("\nAfter Swapping: x = %d, y = %d", x, y);
    return 0;
}


23. Write a code to generate random numbers in C Language.

#include&lt;stdio.h&gt;
#include&lt;stdlib.h&gt;
int main()
{
      int a,b;
      for(a=1;a&lt;=10;a++)
      {
                b=rand();
                printf("%dn",b);
      }
return 0;
}

πŸ’₯IF Anyone Wants to Buy " Premium PDF For Interview " to crack programming

 interview or HR interview of any Software Company Message Me on

 WhatsApp 7974905425. //  Price 200

For More Updates Join WhatsApp Group : Join Group

Subscribe on YouTube for exam and interview Preparation : Subscribe


And if you want more question related to this topic or any other topic contact me. 
Contact form is given below.

Post a Comment