The program must print from 1 to 100 with the values separated by a hyphen.
Python
print('-'.join([str(ctr) for ctr in range(1, 101)]))
Java
import java.util.*;
public class Hello {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num1 = sc.nextInt();
int num2 = sc.nextInt();
System.out.print(num1 - num2);
}
}
C
#include <stdlib.h>
#include <stdio.h>
int main()
{
int ctr;
for(ctr = 1; ctr < 100; ctr++)
{
printf("%d-", ctr);
}
printf("%d", ctr);
return 0;
}
C++
#include <iostream>
using namespace std;
int main()
{
int ctr;
for(ctr = 1; ctr < 100; ctr++)
{
cout << ctr << '-';
}
cout << ctr;
return 0;
}