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);
}
Answers were Sorted based on User's Feedback
Answer / sri
output is 1 but this prg display 2 warning (ie) Nonportable
pointer comparsion
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / vignesh1988i
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 ? | 4 Yes | 1 No |
difference between spiral and waterfall model
Why c is called top down?
1. Write a C program to count the number of occurrence of a specific word in the given strings. (for e.g. Find how many times the word “live” comes in the sentence “Dream as if you’ll live forever, live as if you’ll die today ”)
What is pointer to pointer in c language?
What is #include conio h?
What is a far pointer?What is the utility?
what is difference between array,strutter,union and pointers
3 Answers CTS, Lovely Professional University, Mannar Company,
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=
please tell me the logic for this C program : INPUT (string):ABCD OUTPUT :BCDA CDAB DABC
What is an lvalue in c?
What is wrong with this declaration?