Do calculation inside printf : Console Output Int « Console « C / ANSI-C






Do calculation inside printf

#include <stdio.h>

int main(void)
{
  int len, width, height;

  printf("Enter length: ");
  scanf("%d", &len);

  printf("Enter width: ");
  scanf("%d", &width);

  printf("Enter height: ");
  scanf("%d", &height);

  printf("Volume is %d.", len * width * height);

  return 0;
}
           
       








Related examples in the same category

1.Output int value
2.Print a int with a string
3.Output int value to console
4.Read and write int value in console