Question
main()
{
int i=10;
void pascal f(int,int,int);
f(i++,i++,i++);
printf(" %d",i);
}
void pascal f(integer :i,integer:j,integer :k)
{
write(i,j,k);
}
Question Submitted By :: Susie
I also faced this Question!!
Rank
Answer Posted By
Re: main()
{
int i=10;
void pascal f(int,int,int);
f(i++,i++,i++);
printf(" %d",i);
}
void pascal f(integer :i,integer:j,integer :k)
{
write(i,j,k);
}
Answer
# 1
Answer :
Compiler error: unknown type integer
Compiler error: undeclared function write
Explanation:
Pascal keyword doesn’t mean that pascal code can be
used. It means that the function follows Pascal argument
passing mechanism in calling the functions.
Susie
Other C Code Interview Questions
Question Asked @ Answers What are segment and offset addresses? Infosys 1 main()
{
int i=5;
printf(“%d”,i=++i ==6);
} 1 main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
} 1 main()
{
char *p = “ayqm”;
printf(“%c”,++*(p++));
} TCS 2 Finding a number which was log of base 2 NetApp 1 main()
{
int i=10;
void pascal f(int,int,int);
f(i++,i++,i++);
printf(" %d",i);
}
void pascal f(integer :i,integer:j,integer :k)
{
write(i,j,k);
} 1 What is the hidden bug with the following statement?
assert(val++ != 0); 1 void main ()
{
int x = 10;
printf ("x = %d, y = %d", x,--x++);
}
a. 10, 10
b. 10, 9
c. 10, 11
d. none of the above HCL 1 main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
} 1 union u
{
struct st
{
int i : 4;
int j : 4;
int k : 4;
int l;
}st;
int i;
}u;
main()
{
u.i = 100;
printf("%d, %d, %d",u.i, u.st.i, u.st.l);
}
a. 4, 4, 0
b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0 HCL 1 void main()
{
char a[]="12345\0";
int i=strlen(a);
printf("here in 3 %d\n",++i);
} 1 void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
} 1 #define SQR(x) x * x
main()
{
printf("%d", 225/SQR(15));
}
a. 1
b. 225
c. 15
d. none of the above HCL 1 How do you write a program which produces its own source
code as its output?
7 main()
{
printf("%d, %d", sizeof('c'), sizeof(100));
}
a. 2, 2
b. 2, 100
c. 4, 100
d. 4, 4 HCL 3 write the function. if all the character in string B appear in
string A, return true, otherwise return false. Google 10 #define int char
main()
{
int i=65;
printf("sizeof(i)=%d",sizeof(i));
} 1 union u
{
union u
{
int i;
int j;
}a[10];
int b[10];
}u;
main()
{
printf("\n%d", sizeof(u));
printf(" %d", sizeof(u.a));
// printf("%d", sizeof(u.a[4].i));
}
a. 4, 4, 4
b. 40, 4, 4
c. 1, 100, 1
d. 40 400 4 HCL 1 main()
{
int x=5;
clrscr();
for(;x<= 0;x--)
{
printf("x=%d ", x--);
}
}
a. 5, 3, 1
b. 5, 2, 1,
c. 5, 3, 1, -1, 3
d. –3, -1, 1, 3, 5 HCL 1 void main()
{
int i=10, j=2;
int *ip= &i, *jp = &j;
int k = *ip/*jp;
printf(“%d”,k);
} 1 For more C Code Interview Questions Click Here