Math calculation on the int type - C Language Basics

C examples for Language Basics:Hello World

Description

Math calculation on the int type

Demo Code

#include <stdio.h>

int main(void){
    int n, n2, n3;
    //w  ww .j  av  a 2 s .c  o m
    n = 5;

    n2 = n * n;

    n3 = n2 * n2;

    printf("n = %d, n squared = %d, n cubed = %d\n", n, n2, n3);
    
    return 0;
}

Related Tutorials