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..

Wednesday, February 24, 2010

30

#include< stdio.h >
int main()
{
int a;
printf("enter no.");
scanf("%d",&a)+1;
a=printf("%d",a++)+a;
printf("%d",a);
return 0;
}


Output:


enter no.
2


2
4

Note: This program will show one warning i.e.,"Code Has no effect" (scanf("%d",&a)+1; this line does nothing).

29

#includedeny stdio.h >
#define shark(s) printf("%d",s);
#define srini(b) b-1
int main()
{
shark(2*srini(2))
}


Output:


3