int i;

main(){

int t;

for ( t=4;scanf("%d",&i)-t;printf("%d\n",i))

printf("%d--",t--);

}

// If the inputs are 0,1,2,3 find the o/p

Answers were Sorted based on User's Feedback



int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf(..

Answer / sandeep

answer :

4--0
3--1
2--2

Is This Answer Correct ?    13 Yes 5 No

int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf(..

Answer / susie

Answer :

4--0

3--1

2--2

Explanation:

Let us assume some x= scanf("%d",&i)-t the values
during execution

will be,

t i x

4 0 -4

3 1 -2

2 2 0

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More C Code Interview Questions

What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

1 Answers  


main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }

2 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,


main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 Answers  


main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above

3 Answers   HCL,






main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }

2 Answers  


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


How do you write a program which produces its own source code as its output?

7 Answers  


void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }

4 Answers  


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

0 Answers   Home,


code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123

1 Answers   HCL,


Finding a number which was log of base 2

1 Answers   NetApp,


Categories