Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to demonstrate function overloading by creating multiple versions of a print function.

Hard

Problem Statement

Write a program to demonstrate function overloading by creating multiple versions of a print function.

Sample Input

print(5); print(5.5);

Sample Output

Integer: 5
Double: 5.5

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <iostream> void print(int value); void print(double value); int main() { // Logic to demonstrate function overloading return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
print(5); print(5.5);
Expected Output
Integer: 5
Double: 5.5