Search
 
SCRIPT & CODE EXAMPLE
 

C

Write a C program to multiply two integers using pointers.

#include <stdio.h>
 
int main()
{
// Declare 2 numbers
    int num1, num2;
    int    mul;
// Declare 2 integer pointers
    int *ptr1, *ptr2;
 
// Assign numbers address to pointers
    ptr1 = &num1; 
    ptr2 = &num2; 
 
    printf("Please enter two numbers for Multiplication: ");
    scanf("%d%d", ptr1, ptr2);
 
    mul = *ptr1 * *ptr2;
 
    printf("The Multiplication Results are = %d", mul);
 
    return 0;
}
Comment

Write a C program to multiply two integers using pointers.

#include <stdio.h>
 
int main()
{
// Declare 2 numbers
    int num1, num2;
    int    mul;
// Declare 2 integer pointers
    int *ptr1, *ptr2;
 
// Assign numbers address to pointers
    ptr1 = &num1; 
    ptr2 = &num2; 
 
    printf("Please enter two numbers for Multiplication: ");
    scanf("%d%d", ptr1, ptr2);
 
    mul = *ptr1 * *ptr2;
 
    printf("The Multiplication Results are = %d", mul);
 
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: c add char to char array 
C :: command args c 
C :: tuples in c 
C :: time include c 
C :: array of strings c 
C :: bool c++ 
C :: finding characters in string 
C :: c check if character is lower case 
C :: writing structures in c 
C :: c calling a function 
C :: getchar declaration in c 
C :: create syscall 
C :: localStorage.setItem multpile arra 
C :: printing a string with putchar 
C :: C/c drop mime 
C :: left me on read 
C :: anthracnose pronounce 
C :: bool print variable in c 
C :: convert c to python online 
C :: clipboard lib 
C :: c stack 
C :: Categorize students according to their marks 
C :: c type conversion 
C :: C Nested if...else 
C :: fgets langage c 
C :: too many arg 
C :: The closest in between 
C :: function pointer in c 
C :: how to compare string in c 
C :: default password raspberry pi 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =