Read and write int value in console : Console Output Int « Console « C / ANSI-C






Read and write int value in console

#include <stdio.h>

int main(void)
{
  int i;

  printf("Enter a number: ");
  scanf("%d", &i);
  printf("%d", i * i);

  return 0;
}
           
       








Related examples in the same category

1.Output int value
2.Print a int with a string
3.Do calculation inside printf
4.Output int value to console