JavaScript උදව්වක්...

Absolute Zero

Well-known member
  • Mar 31, 2015
    13,268
    1
    16,822
    113
    −273.15°C
    Problem is Solved,Don't Reply....


    ජාවාස්ක්‍රිප්ට්වලින් තියෙන මේ පොඩි ප්‍රෝග්‍රෑම් එකේ අවුල මොකක්ද කියලා දන්න කෙනෙක් ඉන්නවා නම් කියන්නකෝ,රේන්ජ් එක දැම්මත් හරියටම ග්‍රේඩ් එක එන්නෙ නෑ.:dull:


    Code:
    <script>
     var marks=prompt("Insert Your Marks ","");
    if (marks>=35)
    {
        alert("Your Result is S");
    }
    else if (marks>=55)
    {
        alert("Your Result is C");
    }
    else if (marks>=65)
    {
        alert("Your Result is B");
    }
    else if (marks>=75)
    {
        alert("Your Result is A");
    }
    else (marks<35)
    {
        alert("Your Result is F");
    }
    </script>
     
    Last edited:
    • Like
    Reactions: Pessimist

    Pessimist

    Well-known member
  • Mar 6, 2018
    20,665
    1,562
    113
    🌎
    ලකුණු 50ක් වගේ අරගෙන නං මුලිංම බලනව 35ට වැඩිද කියල වැඩි නිසා Your Result is S කියල print වෙලා program එක නවතිනව
     

    Absolute Zero

    Well-known member
  • Mar 31, 2015
    13,268
    1
    16,822
    113
    −273.15°C
    ලකුණු 50ක් වගේ අරගෙන නං මුලිංම බලනව 35ට වැඩිද කියල වැඩි නිසා Your Result is S කියල print වෙලා program එක නවතිනව


    hari,kohomada bn code karanne A B C S enna?
     

    thilina91

    Member
    May 28, 2008
    18,560
    858
    0
    New World, Grand Line
    if (marks>=75)
    {
    alert("Your Result is A");
    }
    else if (marks>=65)
    {
    alert("Your Result is B");
    }
    else if (marks>=55)
    {
    alert("Your Result is C");
    }
    else if(marks>=35)
    {
    alert("Your Result is S");
    }
    else
    {
    alert("Your Result is F");
    }
     
    • Like
    Reactions: Absolute Zero

    Pessimist

    Well-known member
  • Mar 6, 2018
    20,665
    1,562
    113
    🌎
    ooke piliwelata neda bn yanna oona?

    thanks wewa!

    if දාල else දැම්මාම if condition එක true වුනොත් ඊලඟට තියෙන conditions බලන්නෙ නෑ. උඹේ ඒකේ මුලිංම 35ට වැඩිද බලනව එතනිං එහා අනික්ව බලන්නෑ. ඒකයි අවුල. 90 දැම්මොත් 35ට වැඩි හින්ද S කියල print වෙනව යට තියෙන ඒව බලන්නෑ
     

    Absolute Zero

    Well-known member
  • Mar 31, 2015
    13,268
    1
    16,822
    113
    −273.15°C
    if දාල else දැම්මාම if condition එක true වුනොත් ඊලඟට තියෙන conditions බලන්නෙ නෑ. උඹේ ඒකේ මුලිංම 35ට වැඩිද බලනව එතනිං එහා අනික්ව බලන්නෑ. ඒකයි අවුල. 90 දැම්මොත් 35ට වැඩි හින්ද S කියල print වෙනව යට තියෙන ඒව බලන්නෑ


    Explain karata thanks! :)