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 |
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
Display the time of the system and display the right time of the other country
main() { extern out; printf("%d", out); } int out=100;
write the function. if all the character in string B appear in string A, return true, otherwise return false.
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
main() { int i=10; void pascal f(int,int,int); f(i++,i++,i++); printf(" %d",i); } void pascal f(integer :i,integer:j,integer :k) { write(i,j,k); }
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }