vead
Full Member level 5
what does if statement do within switch statement. I want apply if condition for following task
first case if (task=task1)
second case if (task=task2)
third case if (task=task1)
first case if (task=task1)
second case if (task=task2)
third case if (task=task1)
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #include<reg51.h> //header file #define task1 (1) #define task2 (2) #define task3 (3) //prototype function DoSomething0(); DoSomething1(); DoSomething2(); int main() { unsigned int task; switch (task) { case task1: DoSomething0(); break; case task2: DoSomething1(); break; case task3: DoSomething2(); break; } } DoSomething0() { } DoSomething1() { } DoSomething2() { }