3
If I do, good wheel:
#include <stdio.h>
int op1;
int main(){
scanf("%d", &op1);
switch(op1) {
case 1:
puts("Hello World");
}
}
I wanted to make that by introducing a special character, for example, +, -, / (etc), I show myself in the case, "Hello World" instead of having to put 1. Is there a way? Something like:
#include <stdio.h>
int op1;
int main(){
scanf("%d", &op1);
switch(op1) {
case +:
puts("ola");
}
}
My C is rusty, but try looking for the symbols by matching char, for example,
case #10
– DH.
Did any of the answers solve the problem? Do you think you can accept one of them? See [tour] how to do this. You’d be helping the community by identifying the best solution. You can only accept one of them, but you can vote for anything on the entire site.
– Maniero