main()

{

int i;

clrscr();

printf("%d", &i)+1;

scanf("%d", i)-1;

}

a. Runtime error.

b. Runtime error. Access violation.

c. Compile error. Illegal syntax

d. None of the above



main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d",..

Answer / guest

d, printf( ) prints address/garbage of i,

scanf() dont hav & sign, so scans address for i

+1, -1 dont hav any effect on code

Is This Answer Correct ?    13 Yes 5 No

Post New Answer

More C Code Interview Questions

What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

0 Answers   IBM,


how to return a multiple value from a function?

5 Answers   Wipro,


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

2 Answers  


main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }

1 Answers  






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

1 Answers  


struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error

3 Answers   HCL,


You are given any character string. Find the number of sets of vowels that come in the order of aeiou in the given string. For eg., let the given string be DIPLOMATIC. The answer returned must be "The number of sets is 2" and "The sets are "IO and AI". Vowels that form a singleton set must be neglected. Try to post the program executable in gcc or g++ or in java.

3 Answers  


Printf can be implemented by using __________ list.

3 Answers  


main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above

3 Answers   BrickRed, HCL,


writte a c-programm to display smill paces

2 Answers  


write a program in c to merge two array

2 Answers  


Categories