- Find the output of the following C program. [AMD Jan-2026]
#include <stdio.h>
int main()
{
int sum = 0, i = 6;
for (i = 0; i < 6; i++)
{
if (i % 2 == 0)
continue;
sum += i;
if (sum > 5)
break;
printf("%u", i);
}
printf("|%d %d", i, sum);
return 0;
}
- Find the output of the following C program. [AMD Jan-2026, Dec-2026]]
#include <stdio.h>
int main()
{
char s[] = "name";
char *p = s;
printf("%c %c %c", *p, *(p + 2), *p - 2);
return 0;
}
- What is the value of
8 >> 3? [AMD Dec-2026]
- What is the value of
1 << 3? [AMD Dec-2026]
- What is the output? [AMD Dec-2026]
#include <stdio.h>
int fun(void)
{
static int num = 16;
return num--;
}
int main()
{
for (fun(); fun(); fun())
{
printf("%d ", fun());
}
return 0;
}
- What is the output? [AMD Dec-2026]
#include <stdio.h>
#include <stdlib.h>
int main()
{
int *ptr = (int *)malloc(sizeof(int));
*ptr = 10;
free(ptr);
printf("%d", *ptr);
return 0;
}
- What is the output? [AMD Dec-2026]
#include <stdio.h>
int main()
{
int x = 10, y = 20;
int *p1 = &x, *p2 = &y;
if (p1 > p2)
{
printf("P1 is Greater");
}
else
{
printf("P2 is Greater");
}
return 0;
}
- What is the output? [AMD Dec-2026]
#include <stdio.h>
void swap(int *x, int *y)
{
int temp = *x;
*x = *y;
*y = temp;
}
int main()
{
int a = 10, b = 15;
swap(&a, &b);
printf("%d %d", a, b);
return 0;
}
- From the above macro program, what modifications will you do to get the output as square root value? [AMI Nov-2025]
#include <stdio.h>
#define FUN(num) (num * num)
int main()
{
int num = 5;
printf("%d", FUN(num + 1));
return 0;
}
- Guess the output and answer accordingly. [AMI Nov-2025]
#include <stdio.h>
int main()
{
int a = 4, b = 3;
if (a > b) ? printf("%d", a) : return 1;
return 0;
}
- Write a program to reverse the binary bits in a given number. [AMI Nov-2025]
- What is the output? Where is
a stored? How does the compiler know its value? [AMD 11-Feb-2026]
#include <stdio.h>
int main()
{
int a;
printf("%d", a++);
return 0;
}
- What happens during
fun() calling? What if I call the function infinite times? In linker stage where is it stored? Draw the data segments. [AMD 11-Feb-2026]
#include <stdio.h>
void fun()
{
int a;
printf("%d", a++);
}
int main()
{
fun();
return 0;
}
- What happens if the function is called 10 times? What is the variable value every time? What happens if the variable is
static? [AMD 11-Feb-2026]
#include <stdio.h>
void fun()
{
int a = 1;
printf("%d", a++);
}
int main()
{
fun();
return 0;
}
- What is the output? [AMD 11-Feb-2026]
#include <stdio.h>
static int a = 5;
int main()
{
static int a = 10;
printf("%d\n", a);
return 0;
}
- which header file contains the rand() function in C? * 1 point stdio.h rand.h stdlib.h math.h
-
What is the output of the following code snippet?int x=0;
for(int i=0;i<32;i++)
x+=(1<<i);printf(“%d”,x);
*
1 point
4294967295
-4294967296
-1
-
Consider the following snippet:
int a=0x ;
char *c;
c=&a;
printf("%x\n",a);
for(int i=0;i<4;i++)
printf("%c",*(c+i));
Assuming Little Endian location, what must be filled in the blank to get the output “ABCD”:*
1 point
44434241
61626364
64636261
4142434413)) Suppose I run the following on the linux terminal
gcc program.c
- Which of the following commands executes the code while taking console input from in.txt? * 1 point ./a.out < in.txt ./a.out << in.txt ./a.out in.txt ./a.out -i in.txt
-
What’s the number closest to the output?
#include<stdio.h> int main() { int sum =0; for(int i=1;i<1000;i++) { sum += 6*1/(i*i);
} printf("%d\n",sum); } * 1 point π2 π2 /6 6 7
-
What is the minimum time complexity required to compute the product of an integer with N digits? * 1 point O(n) 0(n2) O(log2n) O(n log2n)
16)
In C++, what is the output of the following code?
#include<iostream> using namespace std; int main() { int x=34; cout<<(x<<4)<<endl; } * 1 point 344 544 Compilation error None of the above
- Arrange operator precedence in decending order1) &-reference 2) &&-logical AND 3) &-bitwise AND
-
#include<stdio.h>
int main()
{
int x=0;
for(int i=0; i<32; i++)
{
x=x+(1<<i);
}
print f("%d",x);
return 0;
-
In C++, what is the output of the following code?#include<iostream>
using namespace std;
int main()
{
int x=34;
cout<<(x<<4)<<endl;
}a)344
b)544
c)Compilation error
d)None of the above
- What does dynamic programming achieve? a)Improves space complexity and time complexity b)Sacrifices space complexity for time complexity c)Sacrifices time complexity for space complexity d)Sacrifices time complexity and space complexity
-
Online C compiler to run C program online
#include <stdio.h>
int main()
{
int x=0;
for(int i=0;i<32;i++)
x+=(1<<i);
printf(“%d”,x);
}
-
What is the output of the following code snippets int a=1<<2+1<<2;
a+=a|a/2;
a*=(a>a^a/2)?a:a^a/2;
printf("%d ",a);
-
#include<stdio.h>
int main()
{
int sum =0;
for(int i=1;i<1000;i++)
{
sum += 6*1/(i*i);}
printf("%d\n",sum);
}
-
What is the output of the following C program? #include<stdio.h> #include<string.h> int main()
{
char *str="y";
char c='y';
char array[1];
array[0]=c;
printf("%d %d ",strlen(str),strlen(array));
return 0;
}
Options :
2 1
2 2
1 (undefined value)
1 1
-
.What is the output of the following C program? #include <stdio.h> void myFunction(const int *); int main()
{
const int i=20;
printf("%d",i);
myFunction(&i);
printf("%d",i);
}
void myFunction(const int *i);
{
*i=30;
}
Options:
20 30
Undefined value
20
Compilation error
-
What is the output of the following C program? #include<stdio.h> void main() {
int x=3;
int y=++x + x++ + --x;
printf("value of y is %d",y);
}
Options:
Undefined value
Value of y is 12
Value of y is 13
Value of y is 10
-
What is the output of the following C program? #include <stdio.h> int main() {
int a[4]={1,2,3,4};
int i;
for(i=0;i<4;i++)
if((char)a[i]=='4')
printf("%d",a[i]);
else
printf("FAIL");
}
Options:
The program compiles and displays the ASCII value of 4
he program compiles and displays 4
Compiler reports an error
The program compiles and displays FAIL 4 times
-
What is the output of the following C program? #include<stdio.h> int main() {
int a=0;
a=5||2|1;
printf("%d",a);
}
Options:
8
7
0
1
-
What is the output of the following C program? #include <stdio.h> int main() { int a,b,c;
a=0x10; b=010;
c=a+b;
printf("%d",c);
}
Options:
Error
Garbage
24
20
-
What is the output of the following C program? #include <stdio.h> void solve() {
int x=2;
printf("%d",(x<<1)+(x>>1));
}
int main()
{
solve();
}
Options:
1
4
5
2
-
What will be the output of the following C code? #include <stdio.h> int main() {
int x=-2;
x=x>>1;
printf("%d" ,x);
}
Options:
Either -1 or 1
1
-1
2 31 – 1 considering int to be 4 bytes
}
-
What is the output of the following code snippets
#include<stdio.h>
int main()
{
int i;
for(i=0;i<5;i++)
{
if(i>3)
break;
printf("%d",i);
}3.#include<stdio.h>
int main()
{
int i;
for(i=0;i<5;i++)
{
if(i>3)
continue;
printf("%d",i);
}
-
int main()
int arr[]={1,2,3,4,5}; *ptr={2,4,5,6}; arr=p; printf("%d%d%d",arr[1],*ptr,*(ptr+1)); }
- int main() { int arr[10]={1,2,3,4,5}; int *ptr=arr; printf(“%d”,*(ptr+5)); }
- int main() { int arr[]={1,2,3,4,5}; printf(“%d”,arr[5]); }
-
fun() { static int i=10; printf("%d",i); i++; }
int main() { fun(); fun(); }
- #include<stdio.h> int main() { int a=0x1234; a=a>>12; a=a<<12; printf(“%x”,a); }
-
#include<stdio.h> int main() { printf("%x",-1); }
10.#include<stdio.h> int main() { printf("%d",'a'); }
-
swap(int a,intb) { int temp=a; a=b; b=temp; }
int main() { int x=2,y=3; swap(x,y); printf("%d%d",x,y); return o; }
- find the size of the union union stu { int a; int a[2]; int a[3]; }
- #include<stdio.h> void fun(void) { static int i=10; printf(“%d”,i); i++; } int main() { fun(); fun(); }
- int main() { int a=0,b=0,c; c=(a=0)?1:2; printf(“%d%d%d”,a,b,c); }
- int main() { int a=1,b=2,c=3; int *ptr=&c; a=c/*ptr; b=c; printf(“%d%d”,a,b); }
- int main() { int i=3; while(i–) { int i=100; i–; printf(“%d”,i); } return 0; }
- #include<stdio.h> int main() { int a=4; switch(a) { case 1:a+=2;break; default:a+=5; case 2:a+=1;break; case 3:a+=3;break; } printf(“%d”,a); }
-
int main { printf("%d",'a'); }
options 1- 61 2-a 3-97 4-none
-
#include<stdio.h>
auto int X=40;
int main()
{
int X=20;
printf("%d\n", X);
return 0;
}
-
int main()
{
(1>2)?return 1:return 2;
}
-
include<stdio.h>
int main()
{
int a[4] = {1,2,3,4};
int *p=a[3];
printf("%d,a[*p]);
return 0;
}
-
#include<stdio.h> int main()
{
int (*p)() = fun;
(*p)();
return 0;
}
int fun()
{
printf("IndiaBix.com\n");
return 0;
}
-
#include<stdio.h>
int main()
{
int pr=1;
printf("%d",printf);
}
-
include<stdio.h>
int main()
{
int k, num = 30;
k = (num < 10) ? 100 : 200;
printf("%d\n", num);
return 0;
}
-
include<stdio.h>
int main()
{
void fun();
int i = 1;
while(i <= 5)
{
printf("%d\n", i);
if(i>2)
goto here;
}
return 0;
}
void fun()
{
here:
printf("It works");
}
-
include<stdio.h>
int main()
{
char ch='a';
if(ch%10)
{
printf("hi");
}
else
printf("hello");
}
-
#include<stdio.h>
int sumdig(int);
int main()
{
int a, b;
a = sumdig(123);
b = sumdig(123);
printf("%d, %d\n", a, b);
return 0;
}
int sumdig(int n)
{
int s, d;
if(n!=0)
{
d = n%10;
n = n/10;
s = d+sumdig(n);
}
else
return 0;
return s;
}
-
#include<stdio.h>
int main() { int i; #if A printf("Enter any number:"); scanf("%d", &i); #elif B printf("The number is odd"); return 0; }
-
#include<stdio.h> #define MAN(x, y) ((x)>(y)) ? (x):(y);
int main() { int i=10, j=5, k=0; k = MAN(++i, j++); printf("%d, %d, %d\n", i, j, k); return 0; }
-
#include<stdio.h> #define MAN(x, y) ((x)>(y)) ? (x):(y);
int main() { int a=2; a>>1; printf("%d",a); return 0; }
-
#include<stdio.h> #define MAX(a,b) (a * b)
int main() { int x; x = MAX(3+2, 2+7); printf("%d\n", x); return 0; }
- #include<stdio.h> int main() { int *j; void fun(int**); fun(&j); return 0; } void fun(int **k) { int a=10; /* Add a statement here */ }
-
#include<stdio.h>
int main() { struct value { int bit1:1; int bit3:4; int bit4:4; }bit={1, 2, 13};
printf("%d, %d, %d\n", bit.bit1, bit.bit3, bit.bit4); return 0; }
-
#include<stdio.h>
int main() { struct bits { float f:2; }bit;
printf("%d\n", sizeof(bit)); return 0; }
-
#include <stdio.h>
int main() { // Write C code here int prinf=2; printf("%d",printf); return 0; }
-
#include <stdio.h>
int main() { // Write C code here int code [4]={1,2,3,4}; printf("%d",-2[code]); return 0; }
-
#include <stdio.h>
int main() { // Write C code here int *ptr="hello"; ptr[2]='i'; printf("c",ptr[i]); return 0; }
-
#include <stdio.h>
int main() { // Write C code here char arr[3]={'a','b','c'}; printf("%d",(arr[0]%10)++); return 0; }
-
#include <stdio.h>
int main() { // Write C code here unsigned int a=10; printf("%d",~a); return 0; }
- #include <stdio.h> #define mul(a,b) a*b int main() { // Write C code here printf(“%d”,mul(1+3,6+4)); }
- #include <stdio.h> auto int a=5; int main() { // Write C code here a++;++a; printf(“%d”,a); }
- #include <stdio.h> struct num { int bit_1:2; int bit_2:3; int bit_3:3 }; int main() { // Write C code here struct num a; a.bit_1=2; printf(“%d”,a.bit_1); }
-
#include <stdio.h>
int main() { // Write C code here int a=0x7; int b=0x8; printf("%d",a&b); }
-
int main()
{
int x=0,y=5,z;
z=x&&y||++y;
printf("%d %d %d",x,y,z);
}
-
int main()
{ int x=5,y=0,z; z=x&&y||++x; printf("%d %d %d",x,y,z); }
- int main() { int a=5; a=~a; printf(“%d”,a); }
- struct stu { float a:5; }s1; int main() { s1.a=3; printf(“%d”,s1.a); }
- int main() { a=5; a=~a+a<<1; printf(“%d”,a); }
- int main() { char x=’a’; printf(“%d”,(x%10)++) }
-
#include <stdio.h> int main() { int a=-5; a=(a++,++a); printf("%d",a);
return 0; }
- #include<stdio.h> int main() { char *str[]={“Technologies”,”are”,”made”,”up”,”of”,”technology”}; printf(“%d %d”,sizeof(str),sizeof(str[0])); }
- int fun() { static int num=15; return num–; } int main() { for(fun();fun();fun()) printf(“%d”,fun()); }
-
int main()
{
unsigned int a=10;
a=~a;
printf("%d/n",a);
}
-
main()
{
if(7&8)
printf("honesty");
if((~7&0x00f)==8)
printf("is the best policy");
}
-
main()
{
int a=2; if(a>>1) printf("%d",a); }
- void main() { printf(“hello”); main(); }
- auto int x; int main() { int x=3; printf(“%d”,x); }
- void main() { int printf=12; printf(“%d”,printf); }
-
#include <stdio.h>
int main() { int x=8; int k= 0==1 &&x++; printf("%d %d",k,x);
return 0; }
- int main() { printf(“%d”,fun(323)); } int fun(int num) { while(num) { count++; num>>=1; return count; }
- char ch=’A’; do{ printf(“%c “,ch); }while(++i||++(ch+1))
- int main() { int a=5; a=~a; printf(“%d”,a); }
- int main() { fun(10); } int fun(volatile int a) { a++; printf(“%d”,a); }
- int num=15; for(fun();fun();fun()) printf(“%d”,fun()); int fun() { return num–; }
- auto int a=3;// in gloal area if(a==3) printf(“…”); else printf(“…”);
- int main() { char ch=’a’; int k=(ch%10)++; printf(“%d”,k); }
- int a=5; a=~a<<1; printf(“%d”,a);
-
#include <stdio.h>
int main() { int a[]={1,2,3,4}; int i=0,*ptr; while(i<4) { ptr=&a[i]; printf("%d ",*(ptr+i)); i++; } }
-
int k=-5; int x=(k++,++k); printf("%d",x);
21. int i=0; while(i<10) { i++; printf("hi"); while(i<=8) { printf("hello"); i++; }}
- main() { int printf=9; printf(“%d”,printf); }
- main() { register static int x; x=10; printf(“%d”,x); }
- int main(static int x) { x=10; printf(“%d %d”,x); }
- int main() { int i=0; printf(“%d %d”,i); }
- void main(){ int a=-5; int k=(a++,++a); pf(“k”); }
- int main(){ char a=’a’; int x=(a%10)++; printf(“x”); }
- int main(){ char *ptr=”hEllo’; char str[]= “world”; ptr[1]=’e’; str[1]=’O’; printf(“ptr,str); }
-
#include<stdio.h>
auto int a; int main() { int a=10; printf("%dn",a); return 0; }
-
#include<stdio.h>
int main()
{
int arr[]={1,2,3},i=0,i++,--I;
arr++;
printf("%d%d",arr[i]);
}
-
#include<stdio.h>
int main()
{
int code[]={1,2,3,4};
printf("%d",-2[code]);
}
-
#include<stdio.h>
int main()
{
int k=8;
int x=0==1 && k++;
printf("%d",x);
}
-
#include<stdio.h>
int main() { int a=2,b=2,c=2,x,y,z; x=(++a)*(++a); y=(b++)*(++b); z=(c++)*(++c); printf("%d%d%d",x,y,z); }
- #include<stdio.h> int main() { int a=0xf0000000; int b=a>>1; printf(“%x”,b); return 0; }
- #include<stdio.h> #define MAX(x,y) ((x)>(y))? (x):(y) int main() { int x=1,y=5; printf(“%d”,MAX(++x,y++); return 0; }
- #include<stdio.h> int main() { int a=5; a=a~5<<1; printf(“%d”,a); return 0; }
- #include<stdio.h> int main() { int arr[5]={1,2,3,4,5}; int sum=0; for(i=0;i<5;i++) { if(i%2==0) { sum=+*(arr+i); } else { sum=-*(arr+i); } } printf(“%d\n”,sum); return 0; }
-
int main()
{
int i=0;
while(i<10)
{
i++;
printf("hi\n");
while(i<8)
{
i++;
printf("hello\n");
}
}
}
-
int a=5;
if(a==5)
{
a=~a+5<<1;
printf("%d",a);
}
-
static int x=3;
x++; if(x<=5) { printf("hi"); } else { printf("hello"); }
- int main() { struct bitfields { int bits_1:2; int bits_2:4; int bits_3:4; int bits_4:3; } bit={2,3,8,7}; }
- int main() { int printf=12; printf(“%d”,printf); }
-
int main() { int i=0; while(i<2) { if(i==1) { break; i++; printf("in loop");
if(i==1) { continue; printf("in while loop "); } } printf("after loop"); }
- int fun(char *msg,…); int main() { fun(“lets code”,2,7,8,10,20); return 0; } void fun(char *msg…) { va=start(ptr,msg); num=va_arg(ptr,int); num=va_arg(ptr,int); }
- int main() { int (*p)()=run; (*p)(); return 0; } int run () { printf(” “); }
- int main() { char temp; char arr[10]={1,2,3,4,5,6,7,8}; temp=(arr+1)[2]; printf(“%d\n”,temp); return 0; }
- int main() { unsigned int a=10; a=~a; printf(“%d”,a); }
- int main() { int a=5; a=~a+5<<1; printf(“%d”,a); }
- int main() { int printf=12; printf(“%d”,printf); }
- int main() { char str1[]=”Hello”; char str2[10]; char *t,*s; s=str1; t=str2; while(*t=*s) { *t++=*s++; printf(“%s\n”,str2); }
- int main() { char a=’a’; x=(a%10)++; printf(“%d\n”,x); }
- int main() { int i=0,j=0; while(i<2) { l1:i++;while(j<3) { printf(“loop\n”); goto l1; } }
- int main() { int code[]={1,2,3,4}; printf(“%d”-2[code]); }
- int main() { int a=-5,k; k=(a++,++a); printf(“%d”,k); }
-
int main()
{
int printf=12;
printf("%d", printf);
return 0;
}
-
int main()
{
int a=5;
a=fun(a);
printf("%d", a);
}
int fun(volatile int a)
{
--a;
printf("%d", a);
return --a;
}
-
struct student
{
char *p;
struct student *s;
}bit;
void main()
{
printf("%d", sizeof(bit);
}
-
int main()
{
int num=30;
int k= (num<10)? 100:200;
printf("%d", num);
}
-
int main()
{
int k=8;
int x=0==1 && k++;
printf("%d%d", x,k);
}
-
int main()
{
if(7 & 8)
printf("Honesty");
if(~7 & 0xf ==8)
printf("is the best policy");
}
-
int main()
{
char str1[]="hello";
char str2[10];
char *t, *s;
s= str1;
t= str2;
while(*t == *s)
{
++t, ++s;
}
printf("%s", str2);
}
-
int main()
{
int a=5;
if(a==5)
{
a= ~a+5<<1;
printf("%d", a);
}
else
{
a= ~a;
}
}
-
void main()
{
int a=3;
a++;
if(a<=5)
{
printf("hi");
main();
}
}
-
int main()
{
int x[4]= {1,3,3,7};
int i;
int *ptr;
for(i=0; i<4; i++)
{
ptr= &x[i];
printf("x[%d] is %d\n", *(ptr+i);
}
}
-
int fun(void)
{
static int a= 15;
return a--;
}
int main()
{
for(fun(); fun(); fun())
{
printf("%d", fun());
}
}
-
#define mul(x,y) x*y
int main()
{
printf("%d", mul(3+6,2+3));
}
-
int fun(int num)
{
int count=0;
while(num)
{
count++;
num= num>>1;
}
return count;
}
int main()
{
int num=323;
int a=fun(323);
printf("%d", a);
}
-
int main()
{
int a=2, b=2, c=2, x, y, z;
x= ++a * ++a;
y= b++ * b++;
z= c+ ++c * c++;
printf("%d%d%d", x, y, z);
}
-
struct student
{
float x:2;
}bit;
int main()
{
printf("%d", sizeof(bit));
}
-
struct student
{
int bit_1=1;
int bit_2=4;
int bit_3=4;
int bit_4=4;
};
struct student bit= { 1, 3,7,8};
int main()
{
printf("%d%d%d%d", bit.bit_1, bit.bit_2, bit.bit_3, bit.bit_4);
}
-
struct student
{
int i;
char *p;
};
int main()
{
struct student a[]= {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
}
-
int main()
{
int a=10, i=0;
while(i<10)
{
i++;
if(i<6)
continue;
else
break;
printf("mirafra");
}
}
-
int main()
{
int i=0, arr[10], ++i, --i;
printf("%d", i);
}
-
int main()
{
char a= 'a';
int z= (a%10)++;
printf("%d", z);
}
-
int main()
{
char s[10]="alan";
char r[10];
r=s;
printf("%s%s", r, s);
}
-
int main()
{
int n=10;
arr[n]={1,2,4};
printf("%d",sizeof(arr));
}
-
int main()
{
int a=10;
printf("%d",a);
}
printf("%d",a);
}
-
main()
{
register int num;
scanf("%d",&num);
printf("%d",num);
}
-
#include<stdio.h>
int main() { char temp; char arr[10]={1,2,3,4,5,6,9,8}; temp=(arr + 1)/[2]; printf("%d\n",temp); return 0; }
- #include<stdio.h> int main() { int arr[]={1,2,3},i=0,i++,–I; arr++; printf(“%d%d”,arr[i]); }
- #include<stdio.h> int main() { int code[]={1,2,3,4}; printf(“%d”,-2[code]); }
- #include<stdio.h> int main() { int a=0xf0000000; int b=a>>1; printf(“%x”,b); return 0; }
- #include<stdio.h> int man() { int a=10; a=~a; printf(“%d”,a); eturn 0; }
- #include<stdio.h> #define MAX(x,y) ((x)>(y))? (x):(y) int main() { int x=1,y=5; printf(“%d”,MAX(++x,y++); return 0; }
- #include<stdio.h> int main() { int a=5; a=a~5<<1; printf(“%d”,a); return 0; }
- #include<stdio.h> int main() { int arr[5]={1,2,3,4,5}; int sum=0; for(i=0;i<5;i++) { if(i%2==0) { sum=+*(arr+i); } else { sum=-*(arr+i); } } printf(“%d\n”,sum); return 0; }
- #include<stdio.h> struct data { int intfield:1 float floatfield:4; }; int main() { struct data d; d.intfield=222; d.floatfield=3.14; printf(“%f\n”,foatfield); return 0; }
-
#include<stdio.h>
int main()
{
char temp;
char arr[10]={1,2,3,4,5,6,9,8};
temp=(arr + 1)/[2];
printf("%d\n",temp);
return 0;
}
-
#include<stdio.h>
int main()
{
int arr[]={1,2,3},i=0,i++,--I;
arr++;
printf("%d%d",arr[i]);
}
-
#include<stdio.h>
int main()
{
int code[]={1,2,3,4};
printf("%d",-2[code]);
}
-
#include<stdio.h>
int main()
{
int k=8;
int x=0==1 && k++;
printf("%d",x);
}
-
#include<stdio.h>
int main()
{
int a=2,b=2,c=2,x,y,z;
x=(++a)*(++a);
y=(b++)*(++b);
z=(c++)*(++c);
printf("%d%d%d",x,y,z);
}
-
#include<stdio.h>
int main()
{
int a=0xf0000000;
int b=a>>1;
printf("%x",b);
return 0;
}
-
#include<stdio.h>
int man()
{
int a=10;
a=~a;
printf("%d",a);
eturn 0;
}
-
#include<stdio.h>
#define MAX(x,y) ((x)>(y))? (x):(y)
int main()
{
int x=1,y=5;
printf("%d",MAX(++x,y++);
return 0;
}
-
#include<stdio.h>
int main()
{
int a=5;
a=a~5<<1;
printf("%d",a);
return 0;
}
-
#include<stdio.h>
int main()
{
int arr[5]={1,2,3,4,5};
int sum=0;
for(i=0;i<5;i++)
{
if(i%2==0)
{
sum=+*(arr+i);
}
else
{
sum=-*(arr+i);
}
}
printf("%d\n",sum);
return 0;
}
-
#include<stdio.h>
struct data
{
int intfield:1
float floatfield:4;
};
int main()
{
struct data d;
d.intfield=222;
d.floatfield=3.14;
printf("%f\n",foatfield);
return 0;
}
-
#include<stdio.h>
int main()
{
float a=1.3;
if(a==1.3f)
printf("true");
else
printf("false");
return 0;
}
-
#include<stdio.h>
int main()
{
int i;
for(i=0;i<10;i++);
{
printf("%d",i);
}
}
-
#include<stdio.h>
int main()
{
int i;
for(;;)
{
printf("forloop");
}
}
-
#include<stdio.h>
int main()
{
if(-5)
{
printf("germany\n");
}
if(5)
{
printf("texa\n");
}
printf("hope\n");
}
-
#include<stdio.h>
int f(int a)
{
a>=20 ? return 10 : return 20 :
}
int main()
{
a=20;
f(a);
printf("%d",a);
}
-
#include<stdio.h>
int main()
{
int a=5;
int b=a++;
printf("%d%d",a,b);
}
-
#include<stdio.h>
int main()
{
int a,b,c;
a=-25%-10;
b=-25%10;
c=25%-10;
printf("%d%d%d",a,b,c);
}
- char *ptr =null strcpy(ptr,”hii”); possible or not [VEM Technologies 2025]
- int *ptr = NULL; printf(“%d %d”, *ptr, &ptr); // → What is the output? [VEM Technologies Feb_2026]
- int main() { int n[3][3] = {{2,4,3}, {6,8,5}, {3,5, 13}}; int *ptr; ptr=n; printf(“%u”,n[2]); printf(“%d”,ptr[2]); printf(“%d”,*(ptr+2)); return 0; }[VOLTY IOT Solutions 25-06-2025]
- int main() { void *vp; char ch=74, *cp=”VOLTY”; int j=79; vp=cp; printf(“%c”,(char)vp); vp=&j; printf(“%c”,(int)vp); vp=cp; printf(“%s”,(char*)vp+2); return 0; }[VOLTY IOT Solutions 25-06-2025]
- Consider the declaration char x[] = “VOLTY”; char *y = “VOLTY”; What is the difference between two declarations? [VOLTY IOT Solutions 25-06-2025]
- int main() { char s[]={‘c’,’0′,’6′,’\n’,’f’,’\0′}; char p, str, *str1; p=&s[3]; str=p; str1=s; printf(“%x”, ++*p + ++*str1); return 0; }[VOLTY IOT Solutions 25-06-2025]
- int main() { int var; int *ptr=&var; *ptr=5; pf(“%d %d”,var,*ptr); } [TRUMINDS]
- int main() { static int var = 5; printf(“%d”, var–); if(var) main(); return 0; }[VOLTY IOT Solutions 25-06-2025]
- int main() { extern int i; i=20; printf(“%d”,i); return 0; } [VOLTY IOT Solutions 25-06-2025]
- static int i=10; int main() { i=5; for(i=0;i<5;i++) { static int a=29; printf(“%d”,a–); } return 0; } [VOLTY IOT Solutions 25-06-2025]
- static int i=9; int main() { i=5; for(;i<5;i++) { static int i=10; printf(“%d”,i); } } [VOLTY IOT Solutions 25-06-2025]
- static int i=10; Int main() { Int i=5; For(i=0;i<5;i++) { a=10; printf(“%d”,a++); } } [VOLTY IOT Solutions 25-06-2025]
-
What the use of structure [Webber Feb_25]
int main() { struct xx { int x=3; char name[] = "hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); return 0; }[VOLTY IOT Solutions 25-06-2025]
-
struct s1 { int x; char c; int y; float z; };
struct s2 { int a; struct s1 b; };
- int main() { struct s2 p = { 25, 195, ‘A’}; printf(“p.b.x = %d\n”, p.b.x); printf(“p.b.z = %f\n”, p.b.z); printf(“p.b.c = %d\n”, p.b.c); return 0; }[VOLTY IOT Solutions 25-06-2025]
-
1)IF n=2 using
int a[++n]=n++;
2)int main()
{
int var;
int *ptr=&var;
*ptr=5;
pf("%d %d",var,*ptr);
}
-
int main()
{
int x,y=5,z=5;
x=y==z;
printf("%d",x);
}
-
int main()
{
for(fun();fun();fun())
{
pf("%d ",fun());
}
}
int fun()
{
static int n=16;
return n--;
}
-
#include<stdio.h>
static int tmp=20;
int main()
{
printf("%d",tmp);
fun();
printf("%d",tmp);
}
void fun()
{
static int tmp=10;
printf("%d",tmp);
}
-
#include<stdio.h>
#if X==10
#define X 5
#else
#define Y 8
#endif
int main()
{
pf("%d %d",X,Y);
}
-
int main()
{
printf("helloworld");
main();`
}
-
#include<stdio.h>
int main()
{
int i=3;
printf("%d",(++i)++);
return 0;
}
-
struct node
{
int i;
float j;
}
struct node *s(10);
-
struct
{
short s[5];
union
{
float y;
cons z;
-
void f(int *p,int m)
{
m=m+5;
*p=p+m;
return;
}
void main()
{
int i=5,j=10;
f(&i,j)
printf("%d",i+j);
}
- the value of(489.1375*0.0843*1.956)/(0-0873*92.581*99.749)
- find the odd num in this series 10,25,45,54,60,75,80
-
#include<stdio.h>
int main()
{
int arr[]="applequiz"
printf("%s",?);
}
-
int main()
{
x:=1;
i:=1;
while(x?5000)
begin
x:=2x;
i:+i+1;
end
what is the value of i
}
-
#include<stdio.h>
int main()
{
int str1[]="applequiz"
int str2[]="applequiz"
printf("%s",sizeof(str);
}