Previous Next
0 / 15
Module DEMO-33-68DEMO-OOP-33

Sum Printer scanf in function

DEMO-OOP-33 β€’ Object Oriented Programming

Browser-only practice

Problem Statement

Write a C function named printSum that reads two integers inside the function and prints their sum.

The function signature should be: void printSum(.

The output format should be strictly: Sum: [value] followed by a newline.


The question lines are locked πŸ”’ you need to write function below main function

Constraints

The integers will be between -1000 and 1000.

Input Format

Two integers separated by space.

Output Format

A single line containing Sum: followed by the calculated sum.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
5 10
Sum: 15
5 + 10 = 15.
Sample #2
Public sample
-5 -10
Sum: -15
-5 + -10 = -15.
Sample #3
Public sample
100 -50
Sum: 50
100 + -50 = 50.
Sample #4
Public sample
0 0
Sum: 0
0 + 0 = 0.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings