ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2254)
 C++ interview questions  C++ Interview Questions (1111)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (646)
Question
write a c program to add two integer numbers without using 
arithmetic operator +
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
main()
{
int a,b,c;
printf("enter a,b values:");
scanf("%d%d",&a,&b);
c=((a)-(-b));
printf("a+b="&c);
}
 
Is This Answer Correct ?    57 Yes 3 No
Praveenkumar
 
Answer
# 2
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=20;
clrscr();
while(b--) a++;
printf("Sum is :%d",a);
getch();
}
 
Is This Answer Correct ?    19 Yes 6 No
Vijayram600
 
 
 
Answer
# 3
main()
{
int a,b,c;
printf("enter a,b values:");
scanf("%d%d",&a,&b);
c=((a)-(-b));
printf("sum of a,b is %d",c);
}
 
Is This Answer Correct ?    9 Yes 2 No
Venky
 
Answer
# 4
#include<iostream.h>
int main()
{
int a,b;
cout<<"Enter a and b";
cin>>a;
cin>>b;
while(a!=0)
{
++b;
a--;
}
cout<<b;
return 0;
}
 
Is This Answer Correct ?    4 Yes 1 No
Sushma Sarma
 
Answer
# 5
a = 53;
int c = 0b10000000;
int d = c;
printf("c=%d\n",c);
s = 30;

while(c>0){
int d = c;
if (a&d){
while ((s&d)&&(d<=128)) {
s = (s&~d);
d = d<<1;
}
d = (d<=128)?d:0;
s = s|d;
}
c = c>>1;
}
printf("s=%d\n",s);
 
Is This Answer Correct ?    3 Yes 1 No
Maksim
 
Answer
# 6
void main()
{
int a=20,b=40;
for( ;b<=1;b--)
a++;
printf("%d",a);
}
 
Is This Answer Correct ?    6 Yes 4 No
Raja
 
Answer
# 7
main()
{
int a,b,c;
printf("enter the values a,b");
scanf("%d%d",&a,&b);
c=a-(~b)-1;
printf("the sum is %d",c);
}
 
Is This Answer Correct ?    1 Yes 0 No
Sivaprabhu
 
Answer
# 8
main()
{
int a,b,c;
printf("enter a,b values:");
scanf("%d%d",&a,&b);
c=((a)-(~b)+1);
printf("sum of a,b is %d",c);
}
 
Is This Answer Correct ?    0 Yes 0 No
Syamanth
 
Answer
# 9
#include<stdio.h>
#include<conio.h.
void main()
{
int a=10,b=20,c;
c=a-(-b);
printf("%d\n",c);
getch();
}
 
Is This Answer Correct ?    0 Yes 0 No
Nandu
 
Answer
# 10
a=0x08;
d=0x02;
e=a|d;
 
Is This Answer Correct ?    2 Yes 7 No
Mohith
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is meant by c   9
write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4 IBM 4
How to use c/c++ code in JAVA Satyam 10
how to generate the length of a string without using len funtion?   4
#include<stdio.h> int SumElement(int *,int); void main(void) { int x[10]; int i=10; for(;i;) { i--; *(x+i)=i; } printf("%d",SumElement(x,10)); } int SumElement(int array[],int size) { int i=0; float sum=0; for(;i<size;i++) sum+=array[i]; return sum; } output? Ramco 5
Explain this code. #include <stdio.h> void f1(int *k) { *k = *k + 10; } main ( ){ int i; i = 0; printf (" The value of i before call %d \n", i); f1 (&i); printf (" The value of i after call %d \n", i); } IBM 2
What is sparse file?   1
how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"   1
main() { int i; printf("%d",scanf"%d",&i))//if the input is 12 24 34 then wat will be the output }   2
how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.   2
what is const volatile?   2
what is the advantage of software development   1
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com