print the name according to the number in javascript

technical talkiess
0

 // 2-vihal 4-sarika 7-lakhan 12 - c printing

function numbercheck(number){
for (let i = 1; i <= number; i++) {
    switch(i){
        case 2:
            console.log("vishal");
            break;
        case 4:
            console.log("sarika");
            break;
        case 4:
            console.log("lakhan");
            break;
        case 12:
                console.log("c");
                break;
        default:
            console.log(i);
                break;
    }
   
}
}
numbercheck(15);
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)