Introduction To Programming

Why programs ? Programming is nothing but making the computers think the same way a human thinks. Programs are made for obtaining a specific solution which can even be solved by humans which when solved by us may consume time..

Saturday, March 27, 2010

73

Predict the Output:
int main()
{
if(1||printf("Logical Programs"))
printf("C Interview Questions");
return 0;
}

Output:
C Interview Questions

for explanation read this post

72

Predict the output:
int main()
{
if(-1)
printf("hi");
if(1)
printf("Bye");
return 0;
}

Output:
hiBye

71

Prdict the output:

int incr(int *pt);
int main()
{
int value=2;
int *ptr;
ptr=&value;
printf("%d %d",*ptr,value);
incr(ptr);
printf("\n%d %d",*ptr,value);
return 0;
}
int incr(int *pt)
{
(*pt)++;
return 0;
}

Output:
2 2
3 3