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 *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”

5 Answers   HCL,


main() { char a[4]="HELLO"; printf("%s",a); }

3 Answers   CSC,


#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

2 Answers   CNSI,


main() { static int var = 5; printf("%d ",var--); if(var) main(); }

1 Answers  


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  






pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 Answers  


What is "far" and "near" pointers in "c"...?

3 Answers  


How can you relate the function with the structure? Explain with an appropriate example.

0 Answers  


find A^B using Recursive function

2 Answers  


#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }

1 Answers  


Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number

2 Answers   Ace Info,


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

0 Answers  


Categories