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

how to swap 3 nos without using temporary variable

4 Answers   Satyam,


#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }

0 Answers  


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


Is it possible to print a name without using commas, double quotes,semi-colons?

7 Answers  


print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!

35 Answers   Tata Elxsi, TCS, VI eTrans,






write a c program to Create employee record by taking details like name, employee id, address and phone number. While taking the phone number, take either landline or mobile number. Ensure that the phone numbers of the employee are unique. Also display all the details

2 Answers   TCS,


main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

6 Answers  


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

1 Answers  


typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


Printf can be implemented by using __________ list.

3 Answers  


How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.

2 Answers  


Categories