0

I am trying to calculate stack usage and execution time of below program,but facing difficulty to understand ,could anyone please tell me how to calculate it..

addition of two number in c

#include <stdio.h>
int main()
{
  int a,b,c;
  printf("enter two numbers\n)";
  scanf("%d%d",&a,&b);
  c=a+b;
  printf("sum of two numbers %d",c);
  return 0;
}
Mat
  • 202,337
  • 40
  • 393
  • 406
Asha
  • 21
  • 6
  • For such a trivial program, actual execution time will likely be buried in general noise of process and OS overhead. For stack usage, it may be best to examine the code's assembly. – paddy Sep 09 '20 at 05:35
  • [Execution time of a c program](https://stackoverflow.com/questions/5248915/execution-time-of-c-program) but in the future, please ask one question per question and I recommend showing a bit more effort/research than this. – ggorlen Sep 09 '20 at 05:36
  • How manually we can calculate while seeing the code? – Asha Sep 09 '20 at 06:04
  • @Asha What do you wan to manually calculate? – kiran Biradar Sep 09 '20 at 06:06
  • I want to calculate stack usage of a particular program.. – Asha Sep 09 '20 at 08:49
  • how much stack is required for that particular program.. – Asha Sep 09 '20 at 08:50

0 Answers0