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
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
What is the output for the following program

     #include<stdio.h>
       main()
      {
      char a[5][5],flag;
      a[0][0]='A';
      flag=((a==*a)&&(*a==a[0]));
      printf("%d\n",flag);
      } 
 Question Submitted By :: Rajesh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }
Answer
# 1
1
 
Is This Answer Correct ?    1 Yes 2 No
Chanda_ni
 
  Re: What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }
Answer
# 2
0
 
Is This Answer Correct ?    3 Yes 1 No
Jaya Prakash
 
 
 
  Re: What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }
Answer
# 3
it gives syntax error
 
Is This Answer Correct ?    3 Yes 1 No
Jyothi
 
  Re: What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }
Answer
# 4
FLAG WILL  give zero..... 
because a refers to the 2D array's base address, *a refers to the value at the 0th row and 0th column.... so this address will not match the ascii value of the char 'A'.... so however it is logical AND so, the value is 0.........



thank u
 
Is This Answer Correct ?    2 Yes 0 No
Vignesh1988i
 
  Re: What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }
Answer
# 5
output is 1 but this prg display 2 warning (ie) Nonportable 
pointer comparsion
 
Is This Answer Correct ?    2 Yes 0 No
Sri
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What are the commands should be given before weiting C Program i.e, Cd.. like Infonet3
How the processor registers can be used in C ? HP4
write a program to generate 1st n fibonacci prime number  5
WAP to accept first name,middle name & last name of a student display its initials? NIIT2
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output CitiGroup4
Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986  1
Why doesn't the code "a[i] = i++;" work?  4
In scanf h is used for BFL2
write an algorithm which can find the largest number among the given list using binary search ............... this was asked in the interview Satyam2
What is the difference between null pointer and the void pointer?  2
write a programme that inputs a number by user and gives its multiplication table.  2
program for comparing 2 strings without strcmp()  3
biggest of two no's with out using if condition statement  2
how to return 1000 variables from functio9n in c?plz give me code also  5
Can I pass constant values to functions which accept structure arguments?  2
a number is perfect if it is equal to the sum of its proper divisor.. 6 is perfect number coz its proper divisors are 1,2 and three.. and 1+2+3=6... a number is deficient if the sum of its proper divisor is less than the number.. sample: 8 is deficient, coz its proper divisors are 1,2 and 4, and 1+2+4=7. abundant number, if the sum of its proper divisor is greater than the number.. sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12. now write a program that prompts the user for a number, then determines whether the number is perfect,deficient and abundant..  1
How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal) Subex1
what is disadvantage of pointer in C Tech-Mahindra5
pick out the odd one out of the following a.malloc() b.calloc() c.free() d.realloc() TCS1
what is the difference between normal variables and pointer variables.............. Satyam7
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
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