void main()
{
int i;
printf("%d", scanf("%d", &i)); // value 10 is given as input here
}
void main()
{
int i=0;
for(;i++;printf("%d", i));
printf("%d", i);
}
void main()
{
char *str1 = "abcd";
char str2[] = "abcd";
printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
void main()
{
struct xx
{
int x=3;
char name[] = "hello";
};
struct xx *s = malloc(sizeof(struct xx));
printf("%d", s->x);
printf("%s", s->name);
}
void main()
{
extern int i;
i=20;
printf("%d", sizeof(i));
}
void main()
{
char *p;
p="Hello";
printf("%c", *&*p);
}
#define clrscr() 100
void main()
{
clrscr();
printf("%d", clrscr());
}
void main()
{
printf("%p", main);
}
void main()
{
char string[]="Hello World";
display(string);
}
void display(char *string)
{
printf("%s", string);
}
void main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}
void main()
{
int i=10;
i=!i>14;
printf("i=%d", i);
}
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
#define square(x) x*x
void main()
{
int i;
i = 64/square(4);
printf("%d", i);
}
void main()
{
char *p="hi friends", *p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s", p1);
}
void main()
{
int c = - -2;
printf("c=%d", c);
}
#define int char
void main()
{
int i = 65;
printf("sizeof(i)=%d", sizeof(i));
}
void main()
{
int i=3;
switch(i)
{
default: printf("zero");
case 1: printf("one"); break;
case 2: printf("two"); break;
case 3: printf("three"); break;
}
}
void main()
{
int i=1;
while(i<=5)
{
printf("%d", i);
if(i>2)
goto here;
i++;
}
}
fun()
{
here: printf("PP");
}
#include<stdio.h>
#define a 10
void main()
{
#define a 50
printf("%d", a);
}
void main()
{
int i=5;
printf("%d%d%d%d%d", i++, i--, ++i, --i, i);
}