I have been trying some programs in the C Language and come across to this...
#include<stdio.h>
int main()
{
int j=3,k;
k=!5&&j;
printf("%d",k);
return 0;
}
can anyone figure out what is the problem in this if i compile the program i will result to 0
and when i tried the same code in c#
public void logic()
{
j = 5;
k = !4 && j;
Console.WriteLine("hence the value would be " + k);
}
this will generate the error*( Error 1 Operator '!' cannot be applied to operand of type 'int' C:\Documents and Settings\SANDEEP\My Documents\Visual Studio 2005\Projects\ConsoleApplication18\ConsoleApplication18\Program.cs 21 17 ConsoleApplication18 )
i want to know why the output of my c code is not working and how can i use the ! operator in c#..... plz help ....