100% found this document useful (3 votes)
4K views3 pages

Zoho Round 1

The document contains 20 code snippets in C/C++. The snippets demonstrate various language features including loops, operators, data types, functions, conditional statements, macros, pointers, arrays, and more. Overall the snippets test a wide range of programming concepts.

Uploaded by

Nanda003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
4K views3 pages

Zoho Round 1

The document contains 20 code snippets in C/C++. The snippets demonstrate various language features including loops, operators, data types, functions, conditional statements, macros, pointers, arrays, and more. Overall the snippets test a wide range of programming concepts.

Uploaded by

Nanda003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

main()
{
char s[ ]="man";
int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[i],*(s+i),*(i+s),i[s]);
}
2) main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}

6) main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}

3.#define int char


main()
{
int i=65;
printf("sizeof(i)=%d",sizeof(i));
}

8) enum colors {BLACK,BLUE,GREEN}


main()
{

Answer: sizeof(i)=1
4. main()
{
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
}
5) main() {
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
}

7) #define square(x) x*x


main()
{
int i;
i = 64/square(4);
printf("%d",i);
}

printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
9. main()
{
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);

10.int main()
{
int example[]={2, 3, 4, 1, 6};
printf("%u, %u, %u\n", example,
&example[0], &example);
return 0;
}

11. int main()


16.main()
{
{
char str1[20] = "Hello", str2[20] = " World";
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
printf("%s\n", strcpy(str2, strcat(str1, str2))); int *p,*q;
return 0;
p=&a[2][2][2];
}
*q=***a;
printf("%d..%d",*p,*q);
}
12.void main(){
17. void main() {
Const int k=5;
int res;
Int num[20]={1,2,3,4,5};
res= 56>76 ? return 0:return 1;
for(k=0;k<5;k++)
printf("%d",res);
printf("%d",num[k]);
}
}

13. int main()


{
int num1 = 123;
float num2 = 123.0;
if(num1 == num2)
printf("num1 and num2 are equal");
else
printf("num1 and num2 are not equal");
return 0;
}

18. main()
{
intx,y,z;
clrscr();
scanf("%d%d",x,y);
z=x+y;
printf("%d",z);
return 0;
}
Give input values: x=2,y=3

14.main()
{
int k=1;
printf("%d==1 is
""%s",k,k==1?"TRUE":"FALSE");
}

19. main() {
intx,y;
clrscr();
x=9;y=8;
if(x++,y++)
printf("%d,%d",x+y,y);
return 0;
}

15.int i=10;
main()
{
extern int i;
{
int i=20;
{
const volatile unsigned i=30;
printf("%d",i);
}
printf("%d",i);
}
printf("%d",i);
}

20. void main() {


int x=20;
x=-x/++x;
printf("%d",x) ;
}

ANS

You might also like