What will be the output of the following program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int add(int a,int b){return(a+b);} | |
int sub(int x,int y){return(x-y);} | |
int main() | |
{ | |
add(10,30); | |
printf("%d",sub-add+main); | |
return 0; | |
} |
in this program we perform math operations on the base addresses of the functions , so the output is compiler dependant
assume the base address of sub() is 4199876 and add() 4199856 and main() is 4199894
so the output will be 4199914