ALLInterview.com :: Home Page KalAajKal.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  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories >> Code-Snippets >> Programming-Code >> C++-Code
 
 


 

Back to Questions Page
 
Question
what is the use of using for loop as "for(;;)"?
Rank Answer Posted By  
 Question Submitted By :: Jephin
I also faced this Question!!   © ALL Interview .com
Answer
Infinite loop
 
0
San
 
 
Answer
Evaluates the whole loop to be true infinite
 
0
Lalitha
 
 
Answer
for using first inisilization;second test counter;third 
increment/decrement
int i;
syntax: for(i=0;i<=100;i++)
 
0
Arun N Patil
 
 
 
Question
A Binary no. is given, we hav to find it's decimal 
equivalent.
Rank Answer Posted By  
 Question Submitted By :: Itgeet
I also faced this Question!!   © ALL Interview .com
Answer
include<stdio.h>
include<conio.h>
void main()
{
int n,x,a,i;
printf("ENTER THE DECIMAL NO");
scanf("%d'&n);
for(i=2;i<=n;i++)
x=n%2;
a=x/2;
printf("binary %d",a);
getch();
}
 
0
Bunker
 
 
Question
1.program to add any two objects using operator overloading
2.program to add any two objects using constructors
3.program to add any two objects using binary operator
4.program to add any two objects using unary operator
Rank Answer Posted By  
 Question Submitted By :: Nithya
I also faced this Question!!   © ALL Interview .com
Answer
/*Program to add two object using operator overloading */
/* vikas */

#include<iostream.h>
#include<string.h>
#include<stdio.h>
#include<conio.h>



class Stadd
{
private:
char p[20];
public:

 void set(char *k)
 {
 strcpy(p,k);
 }
 Stadd operator+(Stadd c)
 {
 Stadd l;
 strcpy(l.p,p);
 strcat(l.p,c.p);
 return l;
 }
 void display()
 {
 cout<<"The string is = "<<p;
 }
};

void main()
{
char m[]="vikas";
char n[]="kumar";
Stadd ws,wt,wu;
ws.set(m);
wt.set(n);
wu=ws+wt;
wu.display();
getch();
}
 
0
Vikas
 
 
Question
#include<iostream.h>
//main()
//{

class A
{
friend class B;
public:
void read();
};
class B
{
public :
int a,b;
};
void A::read()
{
cout<<"welcome";
}

main()
{
A x;
B y;
y.read();
}

In the above program......,
as B is a friend of A B can have access to all members,i 
cant access y.read .
could you please tell me the reason and what would i code 
to execute this program?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
write a program to larger of two number by using friend 
function in c++
 
0
Manzoor
 
 
Answer
declare friend class b under public
 
0
Nn
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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