Write a C program to add two numbers before the main function
is called.
Answers were Sorted based on User's Feedback
Answer / jhansi rani attuluri
#include<stdio.h>
int sum(int a,int b);
int sum(int a,int b)
{
return a+b;
}
main()
{
int a,b,c;
printf("enter the value for a,b:");
scanf("%d %d",&a,&b);
printf("sum is %d\n",sum(a,b));
}
Is This Answer Correct ? | 19 Yes | 45 No |
Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list)
3 Answers Disney, Google, ZS Associates,
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O
Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);
Write a C function to search a number in the given list of numbers. donot use printf and scanf
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
main() { extern int i; i=20; printf("%d",i); }
To reverse an entire text file into another text file.... get d file names in cmd line
main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
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() { main(); }
What is "far" and "near" pointers in "c"...?