main()

{

char c=' ',x,convert(z);

getc(c);

if((c>='a') && (c<='z'))

x=convert(c);

printf("%c",x);

}

convert(z)

{

return z-32;

}



main() { char c=' ',x,convert(z); getc(c); if((c>..

Answer / susie

Answer :

Compiler error

Explanation:

declaration of convert and format of getc() are wrong.

Is This Answer Correct ?    9 Yes 1 No

Post New Answer

More C Code Interview Questions

Sir... please give some important coding questions asked by product companies..

0 Answers  


struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above

2 Answers   HCL,


main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }

2 Answers   Wipro,


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

2 Answers  


#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }

1 Answers  






Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

9 Answers   Microsoft,


{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

4 Answers  


How to reverse a String without using C functions ?

33 Answers   Matrix, TCS, Wipro,


Program to find the largest sum of contiguous integers in the array. O(n)

11 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


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

1 Answers   HCL,


Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];

1 Answers  


Categories