multiplier using pointers

 #include <stdio.h>


int n_mulplier( int *a , int n ){

    int c =  (n * (*a));

    

    printf(" multiplication is  %d\n", c );

    return ; 

    

}


int main() {

    // Write C code here

    int a , n ;

    printf(" enter value of a : ");

    scanf("%d",&a);

    printf(" enter value of n : ");

    scanf("%d",&n);

    

    printf("a and n are %d and %d before fuction\n", a , n );

    n_mulplier(&a , n);

     printf("a and n are %d and %d after function\n", a , n );

     

    

    

    

   

    

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings