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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories >> Software >> Programming-Languages >> C
 
 


 

Back to Questions Page
 
Question
main()
{
int i,j,A;
for(A=-1;A<=1;A++)
prinf("%d\t",!!A);
}
Rank Answer Posted By  
 Question Submitted By :: Raj
I also faced this Question!!   © ALL Interview .com
Answer
-1    0    1
 
0
Mytri
 
 
Answer
1 0 1
 
0
Kimi
 
 
Answer
hi friends 

in c we must know one thing 1st

any number other than '0' is taken as false in c language 


so as A=-1 1st
so A is true 
 now not of A  i.e !A = false=0
 now not of !A i.e !!A= true =1

so 1st 1 is printed

same if u do for A=0

it will be false 1st than true than false 

i.e 0 is printed

for A=1 same as A=-1


there fore answer is 101
 
0
Ashwin Kumar
 
 
 
Answer
sorry friends one small mistake in above explanation 

hi friends 

in c we must know one thing 1st

any number other than '0' is taken as true in c language 


so as A=-1 1st
so A is true 
 now not of A  i.e !A = false=0
 now not of !A i.e !!A= true =1

so 1st 1 is printed

same if u do for A=0

it will be false 1st than true than false 

i.e 0 is printed

for A=1 same as A=-1


there fore answer is 101
 
0
Ashwin Kumar
 
 
Answer
1        0        1
 
0
Vignesh1988i
 
 
Question
main()
{
  printf("hello%d",print("QUARK test?"));
}
Rank Answer Posted By  
 Question Submitted By :: Raj
I also faced this Question!!   © ALL Interview .com
Answer
QUARK test? hello 11
 
0
Vanitha
 
 
Answer
hello11QUARK test?
 
0
Mytri
 
 
Answer
QUARK TEST

hello 10
 
0
Vinay
 
 
Answer
QUARK test?hello1

first it prints the inner most printf statement and then and the comes to the second printf and returns the number of characters inside the " ". but this wat i think, may be wrong too




thank u.
 
0
Vignesh1988i
 
 
Question
what is the difference between #include<stdio.h> and
#include"stdio.h" ?
Rank Answer Posted By  
 Question Submitted By :: Joydeep Roy
This Interview Question Asked @   TCS , Local
I also faced this Question!!   © ALL Interview .com
Answer
#include<stdio.h>--Search from current directory
#include"stdio.h"--Search from list of directories that are
included in path
 
0
Mytri
 
 
Answer
# include<stdio.h>--- It searches one directory i.e 
specified list of directory.
# include"stdio.h"---- It searches two i.e specified list 
of directory & current directory.
 
3
Shahab
 
 
Answer
#include "stdio.h" 
The compiler will search for a particular stdio.h in the 
current working directory only

where as <stdio.h> the complier looks into default dir. 
which is in most cases /include/lib or you can define this 
directory by your own.
 
2
Sreekanth
 
 
Answer
#include<stdio.h> /* stdio.h is searched in c:\TCP\INCLUDE
folder. If not found gives compilation error

#include "stdio.h" first searches for stdio.h in
c:\TCP\BIN(current diretory) . If not found searches
c:\tcp\include\ for stdio.h file
 
0
Sanjay Chandra
 
 
Answer
when we write #include<stdio.h> preprocessor search for it in include directory directly.but when we write "stdio.h" precessor start searching for this header file from current directoryand then in parent directories.
 
0
Mini Bangar
 
 
Question
what is the function of .h in #include<stdio.h> in c ?
Rank Answer Posted By  
 Question Submitted By :: Joydeep Roy
This Interview Question Asked @   IBM , Wipro
I also faced this Question!!   © ALL Interview .com
Answer
.h is a header file which includes standard input and output
functions
 
0
Mytri
 
 
Answer
u know that every file is exist with extention name
so .h is a extention name of all header file.
 
0
Dilip Kumar
 
 
Answer
thanks both of u ...4r giving d answer
 
0
Joydeep Roy
 
 
Answer
this is called as a header file..... like .txt in
editors.... in this this header file dosent belong to the C
code..... the meaning of this is in this .h files all
functions will be writtern .............. eg. string
fun(),I/O fun(),getch(),clrscr(),math functions() ...... etc
... etc
 
0
Vignesh1988i
 
 
Answer
it is a header file.it stands for"standard input and 
output"file.if you want to give any input to the computer 
or if you want to recieve any output from the computer
(printf,scanf)this header file must be used.
 
0
Meena
 
 
Answer
this header file include EOF function also
 
0
Ishwarya
 
 
Answer
.h Means header file of input output in c.
#include<stdio.h>
it means standered input output header file.
 
0
Dekchand Sharma
 
 
Answer
accrding to my view simply we can say #include<stdio.h> is
a header file .this is include all standered input output of c
.h is used in this syntex is represents the link about the
header file (.h)
         we also write syntex #include<stdio.h> is
#include"stdio.h"    the .h shows that this is a header file..
 
0
Bhawani Shankar
 
 
Answer
.h is the extention of the header file
h indicates that its a header file
 
0
Amatullah
 
 
Question
who did come first hen or agg
Rank Answer Posted By  
 Question Submitted By :: Rawloknath
This Interview Question Asked @   Infosys
I also faced this Question!!   © ALL Interview .com
Answer
First tell me the date of birth of hen & egg?
 
2
Priya
 
 
Answer
egg. 
because it is not particularly mentioned about egg(i.e., 
whether hen's or any other's). since dinosaur lived long 
ago before hens, and they too laid eggs...
 
0
Shaina
 
 
Answer
WHICH IS ORDERED FIRST TO WAITER
 
0
Ankit
 
 
Answer
egg, why because  according to alphabetical order e comes 
first always.
 
0
Jessu Srikanth
 
 
Answer
By scientific logic egg was the first
 
0
Sridhar
 
 
Answer
can you give me that sciencetific reason SRIDHAR plzzzzzzzzz
 
0
Unknown
 
 
Answer
this question is not answerable bcz nobody knpws exact 
answer its only our faith that egg comes first and then hen 
or vise-versa.
 
0
Ishan
 
 
Answer
we know that all species were directly came to earth.... so
hen must have come first in the world of hen family.. this
is equal to a birth of an human being... since we too
belongs to apes family... slowely we developed to become an
human being....

like that hen will have came first and i think i has had a
mate with the opposite sex of it.... so the first chick was
born.......
 then it starts developing and increased its population......


REMEMBER WE ALL (ie) HUMAN BEINGS IN THE WORLD BELONGS TO
ONE FATHER AND ONE MOTHER..... AND THEY BELONG TO ONE APE
AND OPPOSITE SEX OF IT.... AND THEY HAVE BEEN CREATED BY
GOD......... 

however this may be silly ...... to you... but SILLY things
will  change the world.......
                             einstein
 
0
Vignesh1988i
 
 
Answer
LAST IN FIRST OUT
 
0
Sarmatha Tk
 
 
Answer
hen only bcoz 1st think after chick was born from egg it 
does not have strength to survive and take food for their 
growth it needs strength so the species hen was created 
naturally on earth ok
 
0
Sathish
 
 
Answer
ITS ZYGOTE THAT CAME FIRST YOU FOOLS...!
 
0
Rahul Valeja
 
 
Answer
By darwin theory birds were come from fishes.after that the 
first bird laid the egg.
 
0
Ashok Kannan
 
 
Question
Blade logic interview question.


1st round is a written tests with 15 multiple questions 
from c and c++. All are simple basic question.

Like int main ()
{

Int i=65;
Return printf(“%c”, i);

}

2nd and 3rd round is technical interview.

The position for which I was interview was core UNIX and c. 
Yes it is for system programming.

The company has product name blade server. For their server 
they are creating their own command for their purpose.

Example cd command.

We can implement it in a c program by using the chdir() 
function.

So the question asks related to PID, fork, pipe, shared 
memory, signal. 
Write a program in c which will act as cp command.
Rank Answer Posted By  
 Question Submitted By :: Sb1234
This Interview Question Asked @   BladeLogic
I also faced this Question!!   © ALL Interview .com
Answer
Blade logic interview question.


1st round is a written tests with 15 multiple questions 
from c and c++. All are simple basic question.

Like int main ()
{

Int i=65;
Return printf(“%c”, i);

}

2nd and 3rd round is technical interview.

The position for which I was interview was core UNIX and c. 
Yes it is for system programming.

The company has product name blade server. For their server 
they are creating their own command for their purpose.

Example cd command.

We can implement it in a c program by using the chdir() 
function.

So the question asks related to PID, fork, pipe, shared 
memory, signal. 
Write a program in c which will act as cp command.
 
0
Sb1234
 
 
Question
WAP to accept first name,middle name & last name of a 
student display its initials?
Rank Answer Posted By  
 Question Submitted By :: Rina
This Interview Question Asked @   NIIT , Aith
I also faced this Question!!   © ALL Interview .com
Answer
if nybody nows the answer thn tell me pls.
 
0
Rina
 
 
Answer
#include<stdio.h>
#include<conio.h>
void main()
{
   char fname[20],mname[20],lname[20];
   clrscr();
   print("Enter student First Name: ");
   scanf("%c",fname);
   print("Enter student Middle Name: ");
   scanf("%c",mname);
   print("Enter student Last Name: ");
   scanf("%c",lname);
   print("The Output of the Following is: \n");
   printf("%c %c %c",fname[0],mname[0],lname[0]);
   getch();
}
 
0
Chandan Kumar R
 
 
Question
WAP to accept rollno,course name & marks of a student & 
display grade if total marks is above 200?
Rank Answer Posted By  
 Question Submitted By :: Don
I also faced this Question!!   © ALL Interview .com
Answer
Frnds plss tell me the answer
 
0
Don
 
 
Answer
#include<stdio.h>
#include<conio.h>
struct mix 
{
int rollno,m1,m2,m3,total;
char cn;
};
void main()
{
   mix s1;
printf("Enter roll no:");
scanf("%d",&s1.rollno);
printf("Enter course name:");
scanf("%s",s1.cn);
printf("Enter marks of 3 subjects out of 150:");
scanf("%d%d%d",&s1.m1,&s1.m2,&s1.m3);
s1.total=s1.m1+s1.m2+s1.m3;
if(s1.total>200)
{
printf("A grade");
}
getch();
}
 
0
Rohit
 
 
Question
WAP to accept basic salary of an employee?
Calculate it HRA=25%,DA=30%,PF=30%&net salary display all 
contents?
Rank Answer Posted By  
 Question Submitted By :: Don
I also faced this Question!!   © ALL Interview .com
Answer
#include<stdio.h>
void main()
{
long int bs,da,hra,pf;
printf("\nEnter The Basic Salary of Employee: ");
scanf("%d",&bs);
printf("\nDA : %d",da=bs*30/100);
printf("\nHRA : %d",hra=bs*25/100);
printf("\nPF : %d",pf=bs*30/100);
printf("\nNet Salary: %d",da+hra+pf);
}

Hey frnds pls tell me is it a ryt answer or wrong?
Help me out
 
0
Don
 
 
Answer
the program does not yield proper result, cos long int is
used  and then only "%d", instead just use "%ld" like i did
in following
"#include<stdio.h>
void main()
{
long int bs,da,hra,pf;
printf("\nEnter The Basic Salary of Employee: ");
scanf("%ld",&bs);
printf("\nDA : %ld",da=bs*30/100);
printf("\nHRA : %ld",hra=bs*25/100);
printf("\nPF : %ld",pf=bs*30/100);
printf("\nNet Salary: %ld",da+hra+pf);
}
 
0
Yarmia Anuj Kalundia
 
 
Answer
wrong
 
0
Balachander
 
 
Answer
IF UR BASIC SALARY 5000 RS.
HRA=B*25/100;
HRA=1250;
DA=BS*30/100;
DA=1500;
PF=BS*30/100;
PF=1500;
NET SALARY=HRA+DA+PF+BS;
NET SALARY=1250+1500+1500+5000;
NET SALARY= 9250 RS.
THIS IS MY CORRECT ANSWER
 
0
Sanjay
 
 
Answer
My question is that, my salary is Rs. 12,000/-.  In my 
salary, How can calculate the Basic, DA, HRA and other 
conveyance allowancs.  This is for the PF.  Please send the 
detaisl and examples to me at the earleist.  Hope for the 
same.  

Thanks

Salim Kumar A.P.
 
0
Salim Kumar A.p.
 
 
Question
Write a program to accept a character & display its 
corrosponding ASCII value & vice versa?
Rank Answer Posted By  
 Question Submitted By :: Priya
I also faced this Question!!   © ALL Interview .com
Answer
Can any one tell me the answer....
if any one knows the answer pls mail the answer at this id 
plsss
priya_del06@yahoo.com
 
0
Priya
 
 
Answer
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
int x;
char y;
printf("enter the number");
scanf("%d",&x);
printf("enter the char");
scanf("%c",&y);
if(sizeof(x)==2))
{
printf("the equivalent char for given integer is %c ",x);
}
elseif(sizeof(y)==1)
printf("the equivalent integer for given char is %d ",y);
getch();
}
 
0
Ashokan M
 
 
Answer
#include<stdio.h>
#include<conio.h>
main()
{
  char ch;
   printf("enter any charecter %c /n");
   scanf("%c ",&ch);
    printf("the ACSCII value is  %d= /n",ch);
 }
 
5
Govindkrishna
 
 
Answer
#2 is correct.
 
0
Nigus Alene
 
 
Question
Add 2 64 bit numbers on a 32 bit machine
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   NetApp , EMC
I also faced this Question!!   © ALL Interview .com
Answer
16
 
0
Chat4@allinterview.com
 
 
Answer
add 32 bit  part of  each  number first  and and then other
32 bit part use the carry  register as  well in the process
 
5
Ravi
 
 
Answer
8
 
0
Kkm
 
 
Question
what is the diff b/w static and non static variables in C.
Give some examples plz.
Rank Answer Posted By  
 Question Submitted By :: Shariquehabib
This Interview Question Asked @   Wipro
I also faced this Question!!   © ALL Interview .com
Answer
Static variables are used for internal contextual 
communication purpose.
non static variables are not used for contextual 
communication 
for that please go through the below code:
 
static int i=10;
int main()
{ 
int x=20;
Printf(“%d %d”,x, i);
Fun();
return 0;
}
Void Fun()
{
Printf(“%d”, i);
}

In the above code “i” is the static variable and “x “is the 
local variable
 
5
Anil Kumar
 
 
Answer
when we have declared a variable as static...... we cant
initilize it again....... the meaning of static storage
class is for only one time initilization.... whenever the
compailer come accross the same static keyword ,... the
present value in that variable will get printed as the
compailer ignores the line static.........  
eg:::::
#include<stdio.h>
#include<conio.h>
void main()
{
for(int i=0;i<3;i++)
{
   static int p=1;
printf("%d ",p);
p++;
}
         output will be::  1 2 3
since the compailer ignores the static int p=1 after it
initilizs once...... and one more thing.. when we refer
variable p after the loop structure it will give an error
that::: "UNDEFINED SYMBOL 'P'" ,because the scope of this
static is only under the block and not ourtside.....

non static :: it is called as automatic storage class.... in
programs we would have given as;;
              int a; or char sd; etc...
these inside the compailer treated as automatic storage
class..... the scope of this storage class is only undere
the block... after comming out it dies......

eg:::::::
#include<stdio.h>
#include<conio.h>
void main()
{
int a=12;
   {
     a=90;
printf("%d",a);
}
printf("%d",a);
  }
 the output will be:::::::   90 12.... because of the above
mentioned scope.....

i think you can clearely understand the concept....... if
you didnt  understand ... send mail to me.. we can
discuss.... softvig_88@yahoo.com...  
                        thank you
 
0
Vignesh1988i
[Infosys]
 
 
Question
Write a program or provide a pseudo code to flip the 2nd bit
of the 32 bit number ! (Phone Screen)
Rank Answer Posted By  
 Question Submitted By :: Ankit Parikh
This Interview Question Asked @   NetApp , Wipro, Ptu
I also faced this Question!!   © ALL Interview .com
Answer
x-OR the number with 0x02.
 
0
Ankit Parikh
 
 
Question
if a five digit number is input through the keyboard, write
a program to calculate the sum of its digits.
(hint:-use the modulus operator.'%')
Rank Answer Posted By  
 Question Submitted By :: Madhu
I also faced this Question!!   © ALL Interview .com
Answer
main()
{
int num=0,sum=0,k=0;
pirntf("enter the number\n");
scanf("%d",num);
   while(num!=0);
    {
      k=num%10;
      sum=sum+k;
      num=num/10;
    }
printf("%d",sum);
}
 
0
K.kavitha
 
 
Answer
void main()
{
long int num;
int sum=0,temp;
clrscr();
printf("Enter the numbe\n");
scanf("%ld",&num);
while(num!=0)
{
temp=num%10;
sum=sum+temp;
num=num/10;
}
printf("%d",sum);
getch();
}

 
0
Sriharsha
 
 
Answer
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
scanf("%d",&i);
if((i%9)==0)
printf("The sum of digit is 9");
else
{
j=i%9;
printf("%d",j);
}
}
 
0
Jegadeesh
 
 
Answer
#include<stdio.h>
void main()
{
int i,j;
scanf("%d",&i);
if((i%9)==0)
printf("The sum of digit is 9");
else
{
j=i%9;
printf("%d",j);
}
}

//the above will print result as 6 if given as 12345 since
1+2+3+4+5=15 and proceeding 1+5 we get as 6.....
is this an apt answer...
 
0
Jegadeesh
 
 
Answer
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,sum=0;
clrscr();
printf("\n enter a number",i);
scanf("%d",&i);

while(i<=0)
  {
    j=i%10;
    sum=sum+j;
    i=i/10;
   }
printf("\n the sum of the digits 
        are:%d\n");
getch();
}
 
0
Aha Na
 
 
Answer
#include<stdio.h>
#include<math.h>
#include<conio.h>
void main()
{
long int num;
int sum=0,temp;
clrscr();
printf("Enter the numbe\n");
scanf("%ld",&num);
while(num!=0)
{
temp=num%10;
sum=sum+temp;
num=num/10;
}
printf("%d",sum);
getch();
}
 
0
Synner
 
 
Answer
#include<sthio.h>
#include<conio.h>
void main()
{ 
int a,b,c,d,e,f,g,h,i,j,k,l;
printf("enter a five digit number");
scanf("%d",&a);
b=a%10;
c=a/10;
d=c%10;
e=c/10;
f=e%10;
g=e/10;
h=g%10;
i=g/10;
j=i%10;
k=i/10;
l=b+d+f+h+j;
printf("sum of the digit=%d",l);
getch();
}
 
0
Rashmi Sharma
 
 
Answer
#include<stdio.h>
#include<conio.h>
int main()
{
int n,m,m1,s=0,d,sum;
printf("\nEnter the number ");
scanf("%d",&n);
m=n%10;
d=n/10;
while(d>=10)
{
m1=d%10;
d=d/10;
s =s+m1;
}
sum=s+m+d;
printf("\nSum is %d",sum);
getch();
}
 
0
Ruchi
 
 
Answer
#include<stdio.h>
#include<conio.h>
void main()
{
int num=0,sum=0,k=0;
pirntf("enter the number\n");
scanf("%d",num);
   while(num!=0);
    {
      k=num%10;
      sum=sum+k;
      num=num/10;
    }
printf("%d",sum);
getch();
}
 
0
Nishant Rai
 
 
 
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