main(int argc, char **argv)

{

printf("enter the character");

getchar();

sum(argv[1],argv[2]);

}

sum(num1,num2)

int num1,num2;

{

return num1+num2;

}



main(int argc, char **argv) { printf("enter the character"); ..

Answer / susie

Answer :

Compiler error.

Explanation:

argv[1] & argv[2] are strings. They are passed to the
function sum without converting it to integer values.

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More C Code Interview Questions

main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  


Find the largest number in a binary tree

7 Answers   Infosys,


plz send me all data structure related programs

2 Answers  


String copy logic in one line.

11 Answers   Microsoft, NetApp,


How to swap two variables, without using third variable ?

104 Answers   AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,


Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).

13 Answers   Intel, Microsoft, TCS,


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

2 Answers  


Find your day from your DOB?

15 Answers   Accenture, Microsoft,


Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..

2 Answers  


int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


main() { 41printf("%p",main); }8

1 Answers  


Categories