GeekInterview.com
Answered Questions

C program for delete a node from linked list

Asked By: praveen.g | Asked On: May 6th, 2006

Answered by: Sukumar Paul on: Aug 1st, 2010

yaa i am writing the full program here for better understanding: This program will be run on Turbo C++ 3.0 without any error or warning.<-------------------------------------------------------...

Answered by: venkatesh on: May 19th, 2006

struct node{int data;struct node * next;}list;for deleting a node from list first we have read a element which u want to delete and then we have identify previous node of that element.scanf("%d",&...

How do you write a C program which can calculate lines of code but not counting comments?

Asked By: lizz | Asked On: Mar 28th, 2006

Answered by: gpreddy on: Nov 8th, 2006

working code ************************#includemain(){ FILE *f; char ch;int c=0; f=fopen("reddy", "r"); ch=fgetc(f); while(!feof(f)) { switch(ch)...

Answered by: venkatesh on: May 19th, 2006

main(){FILE f=open a file in readmodechar ch;int c=0;ch=fgetc(f);while(!feof(f)){switch(ch){case "/" :  if (fgetc(f)=="*")    while (fgetc(f)!="*" and fgetc(f)!="/");break; ca...

How to remove duplicate elements from an array

Asked By: mitu218 | Asked On: Mar 9th, 2006

Answered by: rimi.mnnit on: May 31st, 2008

//simple BST program with little change#include#includestruct btree{        int data;        struct btree *lnode;        struct btree *rnode;};typedef struct btree *tree_pntr;type...

Answered by: nitin.g.007 on: May 30th, 2008

time complexity will be <O(nlogn)

What is the difference between constant to pointer and pointer to constant?

Asked By: sachinp1979 | Asked On: Feb 18th, 2006

Answered by: venkatesh on: Feb 27th, 2006

pointer to constant: If a pointer is pointing to constant it is called as pointer to constant.In this case we cannot change the content of constant.eg :  const int n=5;  int *p=&n;in thi...

Answered by: laxmikanth_rajuri on: Feb 25th, 2006

Constant pointer:If a pointer is pointing to a constant whose value(constant)can't be changed.Eg:Consider the declaration int a[10];here a is a pointer to the base address of the array say 1000.When w...

The questions are as follows: 1. Write a 'c' program to read the age of 100 persons and count the number of persons in the age group 50 to 60.Use for loop and continue statements.(10 marks)2. Write a program...

Asked By: Arka chakraborty | Asked On: Feb 8th, 2006

Answered by: Sukumar Paul on: Aug 1st, 2010

Answer to Question 4.Here I am giving the full program which should run without any warning and error in Turbo C++ 3.0<-------------------------------------------------------------------------...

Answered by: econos on: May 7th, 2008

#include <stdio.h>#include <math.h>#include <stdlib.h>int main(void){    int x,y,ref;    int numbits=0;    printf("Input the desired...

C is a structural or highlevel or middle level language which one is correct answer

Asked By: suchi | Asked On: Feb 3rd, 2006

Answered by: aswini on: Sep 25th, 2011

c is a high level procedure oriented structured programming language

Answered by: hema on: Sep 15th, 2011

C is middle level language because it perform like low level of operation etc and also perform high level operations so its middle . and C is structural lang

What would be the output of the following program? Main() {      int i=4;      switch(i)      {          ...

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) a) a mouse is an elephant built by the japanese b) b) breeding rabbits is a hare raising experience c) c) a mouse is an elephant built by the japanese breeding rabbits is a hare raising experienced) d) none of the above

Answered by: Jialun on: Jun 27th, 2007

Ans should be A+B because there is no break; at the end of default section which will lead the program flow into the first case till the break;

Answered by: venkatesh on: May 18th, 2006

The answer is C

What is corelated subquery

Asked By: vardhan_81 | Asked On: Nov 9th, 2005

A subquery within a subquery

Answered by: velur1 on: Sep 19th, 2008

A query within a subquery

Answered by: rjk1203 on: Sep 19th, 2008

A Correlated Subquery which executes with value returned by the child Query. Unlike subquery it executes per result from child query.

Ex: removing duplicate rows from a table


Subquery executes once for the entire child query's result

What is the difference between encapsulation and datahiding.Explain with example

Asked By: ramaprasad | Asked On: Nov 2nd, 2005

Answered by: prabhjot kaur on: May 12th, 2012

encapsulation is the wrapping up of data members and data functions into a single unit like classes. here we can control the visibility of data with the help of access specifiers i.e. public,private and protected.
in data hiding data is totally private we cannot access the data.

Answered by: shrimanta on: Mar 14th, 2012

encapsulation is the concept of the datamember. Data Hiding is the Access Specifier.

what are the advantages of using pointers in a program?

Asked By: Interview Candidate | Asked On: Sep 9th, 2005

Answered by: gunturi.prabhakar on: May 30th, 2008

The advantages of using pointers are: 1: you can work with the address of the variable2: you can reference the variables in more different easiest ways....    e.g  int a[10],*b;         Â...

Answered by: thathireddy on: Jan 27th, 2007

thanks your's answer is wellplease send me examples of pointers like functions using pointers,structures using pointers etc

Difference between realloc() and free()?  

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the pointer parameter is not a valid pointer. If the pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to...

Answered by: SomGollakota on: Jun 13th, 2007

free() - releases the memory of the pointer passed as parameter, to the OS/application consumption. Using the pointer after free() will result in undefinded resultsrealloc() - used to resize the memor...

Answered by: Roopesh Majeti on: May 27th, 2007

Mitra,as you mentioned that realloc will delete the existing memory and allocate the new memory . I tried it on solaris and following is found :1. If the new size allocated is less than the existing m...

What is an argument ? Differentiate between formal arguments and actual arguments? 

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

An argument is an entity used to pass the data from calling funtion to the called funtion. Formal arguments are the arguments available in the funtion definition.They are preceded by their own data types.Actual arguments are available in the function call.

Answered by: geetika mahajana on: Oct 7th, 2011

FORMAL ARGUMENT :-The argument declared in function header is called formal argument......

ACTUAL ARGUMENT:- The argument passed to function while the function is called actual parameter.........

Answered by: venkatesh on: May 18th, 2006

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.Simply,  function call contains actual ...

What are the characteristics of arrays in c? 

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

1) an array holds elements that have the same data type         2) array elements are stored in subsequent memory locations3) two-dimentional array elements are stored row by row in subsequent memory locations.4) array name represents the address of the starting...

Answered by: Basavaraj Yadwad on: May 24th, 2006

Array: can be defined as a group of elements stored in contigous memory locations and all elements hold the data of same data type. All elements share a common name - array name.Example: int array[10]...

Answered by: venkatesh on: May 18th, 2006

must be homogenious i.e same data type

How can I sort a linked list?

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

Both the merge sort and the radix sort are good sorting algorithms to use for linked lists.

Answered by: venkatesh on: May 19th, 2006

For this no need to write sepate function. We can arrage the elements in order by using some comaprisons in creation of list.

venkatesh_ch@fastmail.fm

What is the quickest searching method to use?

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

A binary search, such as bsearch() performs, is much faster than a linear search. A hashing algorithm can provide even faster searching. One particularly interesting and fast method for searching is to keep the data in a “digital trie.” a digital trie offers the prospect of being able to search for...

Answered by: saravan_btech on: May 24th, 2006

quick short method is a best one

Answered by: venkatesh on: May 18th, 2006

Insertion sort method is the quick sorting technique

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: