ALLInterview.com :: Home Page Forum9.Com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories >> Code-Snippets
 
 


 

Back to Questions Page
 
Question
What is the main difference between STRUCTURE and UNION?
Rank Answer Posted By  
 Question Submitted By :: Mariaalex007
I also faced this Question!!   © ALL Interview .com
Answer
All the members of the structure can be accessed at
once,where as in an union only one member can be used at a time.
Another important difference is in the size allocated to a
structure and an union.
for eg:
struct example
{
  int integer;
  float floating_numbers;
}
the size allocated here is sizeof(int)+sizeof(float);
where as in an union
union example
{
  int integer;
  float floating_numbers;
}
size allocated is the size of the highest member.
so size is=sizeof(float);
 
0
Vijay Nag
 
 
Question
how to store and retrive a set of values without using an 
array
Rank Answer Posted By  
 Question Submitted By :: Kiran
This Interview Question Asked @   Maximus
I also faced this Question!!   © ALL Interview .com
Answer
please post the answer...



thanks and regards
kiran.y
 
0
Kiran
 
 
Answer
link list i think..
 
0
Karthik
 
 
 
Question
How will u find whether a linked list has a loop or not?
Rank Answer Posted By  
 Question Submitted By :: Vadivel152
This Interview Question Asked @   Microsoft
I also faced this Question!!   © ALL Interview .com
Answer
findloop(struct node *start)
{
 struct node *ptr,*ptr1;
start=ptr;

 while(ptr!=NULL)
{
  ptr1=ptr->next;
  
  while(ptr1!=NULL)
  {
     if(ptr1->link==ptr->link)
     {
        printf("\nLoop found at %d node",ptr->data);
        exit(0);
       }
    ptr1=ptr1->link;
}
ptr=ptr->link;
}
printf("\nNo Loop found in list");
}
 
0
S.v.prasad Reddy
 
 
Answer
BOOL findloop(struct node *start)
{
 struct node *ptr,*ptr1;
 ptr=start;
 ptr1= start->next;
 while(ptr!=NULL && ptr->next!=null && ptr1->next!=null && 
ptr1->next->next!=null)
   {
     if(ptr==ptr1)
          return FALSE;
     ptr=ptr->next;
     ptr1=ptr1->next->next;
   }
  return TRUE;
}
 
0
Sivaraj
 
 
Question
How can u say that a given point is in a triangle?
1. with the co-ordinates of the 3 vertices specified.
2. with only the co-ordinates of the top vertex given.
Rank Answer Posted By  
 Question Submitted By :: Vadivel152
I also faced this Question!!   © ALL Interview .com
Answer
solution for 1st case:
Given:(x1,y1),(x2,y2),(x3,y3),the co-ordinates of the
vertices of the triangle.
 Let (xx,yy) be the pt to be located.
 Find the equations of the lines {(x1,y1),(x2,y2)} and
{(x1,y1)(x3,y3)} using the formula 
((y-y1)/(y2-y1))=((x-x1)/(x2-x1))

 Now substitute the y value  in the 2 equations got. You 'll
be getting the x limits. If the given x value lies within
the limits you have found,the given pt is within the
triangle or else it is not.
 
0
Vadivel
 
 
Question
how to write a program to accept names and marks of 10 
students from the user and display the names and markes of 
only the passed students.  Marks greater than or equal to 
35 is considered as pass.
Rank Answer Posted By  
 Question Submitted By :: Nl
I also faced this Question!!   © ALL Interview .com
Answer
#include<stdio.h>
void main()
{
char names[10][20];
int a[10][2],n;
printf(":enter the number of students :");
scanf("%d",&n);
printf("enter the names and marks");
  for(int i=0;i<n;i++)
{
scanf("%s",names[i]);
scanf('%d",&a[i]);
}
printf("the passed students are :\n");
for(int i=0;i<n;i++)
{
  if(a[i]>=35)
{
printf("%s",names[i]);
}
}
getch();
}
 
0
Vignesh1988i
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com