Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

 Program of React-JS to check prime number using constant object?


import React from "react";


export class Prime extends React.Component

{

    state = {

        num: 9,

        i: 2,

        s:null

      };

    

   constructor()

   {

    

    super();

    

   }

   render()

   {

    const { num } = this.state;

    for(this.state.i=2;this.state.i<num;this.state.i++)

    {

        if(num%this.state.i==0)

        {

            this.state.s = "not prime";

            break;

        }

    }

    if(num==this.state.i)

    {

        this.state.s = "prime";

    }

    return(

       <div>

       

      

       <p>{this.state.s}</p>

       </div>


       )

   } 


}




ASSIGNMENT OF REACT:-


WAP to create a mark sheet using five different subjects with the following conditions?


1)  all subject marks should be 0 to 100?


2)  If only one subject mark is <33 then the student will supply.


3)  If all subject marks are>33 then the student pass and display division with percentage?


4)  if the minimum of two subject marks is <33 then the student will fail.


5)  if the student is suppl and the mark is >28 then five bonus marks will be added then the student will pass by grace and grace subject name.


6) display distinction subject name


7) display suppl subject name







Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post