Showing posts with label Multiple Choice. Show all posts
Showing posts with label Multiple Choice. Show all posts

C Interview Questions and Answers For Freshers/ Experienced

C Interview Questions and Answers For Freshers / Experienced - Important Quiz 

In this section, I have selected Basic and Important C interview questions and answers for all levels of candidates(Fresher level, advanced level,experienced level).
Last few months I have been working to select best question and answer set for C interview questions.

Here is some Important C Interview Questions and Answers for freshers and experienced:

1.Can we have a pointer to a pointer in C?

Answer: Yes

char *a;      -   Pointer to a character

char **a;      -    Pointer to a pointer

2.How to convert strings in c to corresponding Integer?

Answer:
atoi() function convert a string into corresponding integer value.use stdlib.h header file.

3. C Data types?
Answer :Int, char, float, void etc. are predefined basic primitive data types.Structures and Unions are user defined data types.

4.Find the output of the following program? 
#include 
main() 

int i=10; 
printf("%d",++i); 
printf("%d",i++); 
printf("%d",(i++*i++)) 


5.Octal literal in C?
#include
main()
{
int i=020;
printf("i is %d",i);
}
Output:16

Answer :
In c and c ++ language 0 (zero) is the octel literal so it will print its Octel representation of 16.

6.Whats is difference between file descriptor and file pointer?

7.Two forms of #include directive?
Answer :
1.#include”filename”
2.#include

8.Find the output of the following program? 
#include 
main()

    int str=0; 
    if(str==0) 
        printf("True"); 
printf("False"); 
}
Answer :
True
False

9.Find the output of the following program? 
#include 
main()

    int x=0; 
    if(x==0) 
        printf("True"); 
else
printf("False"); 
}

Answer :
True

10.What will be the Output of the following program? 
#include
main()

    int i=50, j=100; 
    i = j++; 
    j = ++j; 
    printf("%d %dn",i,j);
}

Answer :
51, 101

11.What will be the Output of the following program? 

#include
main()
{
int i = 10;
printf("%d", main||i);
}

Answer :
1

12. Write a Program to convert decimal to binary number?
Answer :
#include
main()
{
int x,y,n,arr[50];
clrscr();
printf("Enter the decimal number");
scanf("%d",n);
for(x=0;x
{
arr[x]=n%2;
n=n/2;
}
for(y=n;y>0;y--)
{
printf("%d",arr[y]);
}
getch();
}

Top Important C FAQs and Interview Questions

  1. What is the difference between strings and character arrays?
  2. Differences between pass by reference and pass by value?
  3. What does static variable mean?
  4. What is the use of semicolon at the end of every statement?
  5. What is a null pointer?
  6. What is a pointer?
  7. When would you use a pointer to a function?
  8. What are the uses of a pointer?
  9. In header files whether functions are declared or defined?
  10. What are the differences between malloc () and calloc ()?
  11. What is the heap?
  12. What is the stack?
  13. Difference between const char* p and char const* p?
  14. What is a structure?
  15. What is a union?
  16. What is Operator overloading ?
  17. What is a void pointer?
  18. What is hashing?
  19. What are the different storage classes in C?
  20. What are the differences between structures and union?
  21. What is the difference between calloc() and malloc()?
  22. What are the differences between structures and arrays?
  23. What is the difference between printf() and sprintf()?
  24. What is static memory allocation and dynamic memory allocation?
  25. Define recursion in C?
  26. What is the use of typedef?
  27. How are pointer variables initialized?
  28. What are the advantages of auto variables?


Bookmark and Share

JQuery interview questions and Answers

JQuery interview questions and Answers Advanced (Multiple Choice)- JQuery Quiz.

In this tutorial, I have selected advanced and basic Jquery Interview questions and answers with examples for freshers and 1 to 3 year experienced candidates.I have also included Objective Jquery ajax interview questions.


Advanced  JQuery interview questions and Answers:

What is Jquery?

jQuery is a JavaScript Library.

Which of the following is correct?

jQuery is a JavaScript Library
jQuery is a JSON Library

Answer :jQuery is a JavaScript Library

jQuery uses CSS selectors and XPath expressions to select elements?

False
True

Answer: True

Which sign does jQuery use as a shortcut for jQuery?

$ sign
% sign
? Sign

Answer: $ sign


Is jQuery a W3C standard?

Yes
No

Answer: NO


$("span"). What does it select?

All span elements
The first span element

Answer: All span elements

Is jQuery a library for client scripting or server scripting?

Client scripting
Server scripting

Answer: Client scripting

Is it possible to use jQuery together with AJAX?

Yes
No

Answer: Yes

The jQuery html() method works for both HTML and XML documents

True
False

Answer :False

jQuery code to set the background color of all span elements to blue?

$("span").style("background-color","blue");
$("span").manipulate("background-color","blue");
$("span").css("background-color","blue");
$("span").layout("background-color","blue");

Answer: $("span").css("background-color","blue");


$("span.intro"). What does it select?

The first span element with class="intro"
The first span element with id="intro"
All span elements with id="intro"
All span elements with class="intro"

Answer: All span elements with class="intro"

jQuery method to hide selected elements?

visible(false)
hidden()
display(none)
hide()

Answer: hide()

jQuery method to set one or more style properties for selected elements?

style()
css()
html()
 
Answer: css()

jQuery method is used to perform an asynchronous HTTP request?

jQuery.ajaxAsync()
jQuery.ajaxSetup()
jQuery.ajax()

Answer: jQuery.ajax()


What scripting language is jQuery written in?

VBScript
C++
JavaScript
C#

Answer: JavaScript

$("div#id1 .cl1"). What does it select?

The first element with id="cl1" inside any div element with class="id1"
All elements with class="cl1" inside the first div element with id="id1"
All div elements with id="id1" or class="cl1"

Answer: All elements with class="cl1" inside the first div element with id="id1"


Difference between onload() and document.ready() function used in jQuery?

  • We can add more than one document.ready() function in a page.
  • we can have only one onload function.
  • Document.ready() function is called as soon as DOM is loaded.
  • body.onload() function is called when everything (DOM, images..)gets loaded on the page.


JQuery Methods used to provide effects?

1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut()


What are the different type of selectors in Jquery?

1. CSS Selector
2. XPath Selector
3. Custom Selector

What does .size() method of jquery return ?

.size() method of jquery returns number of element in the object.


 How do you get the text value?

$("#textbox1").val();

 How do you check or uncheck a checkbox input or radio button?

1.$('#num1').attr('checked', true);// Check #num1

2.$('#num1').attr('checked', false);// Uncheck #num1

3.$("#num1").attr('checked', 'checked');// Check #num1

4.$("#num1").removeAttr('checked');// Uncheck #num1


Ajax Request in Jquery

$.ajax({
     url: 'test.php',
     success: function(response) {
        alert(response);
     },
     error: function(res) {
        alert(res.status);
     }
});


Explain the each() function.

$("#num").click(function(){
$("li").each(function(){
document.write($(this).text())
});
});



Bookmark and Share