Skip to content

Commit

Permalink
Update App.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Anindya007 authored Nov 20, 2024
1 parent 2fa671c commit 260d2bc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import PropTypes from "prop-types";
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = { COUNT: 1 };
this.state = { COUNT: 1 , num : 2};
}

render() {
return (
<div>
<h4>Multiples of: {this.props.OF}</h4>
<h4>Multiples of: <input type="text" value={this.state.num} onChange={(e) => {
this.setState({ num: e.target.value})}}/></h4>
<p>
{this.props.OF}*{this.state.COUNT}
{this.state.num}*{this.state.COUNT} = {parseInt(this.state.num) * this.state.COUNT}
</p>
<button onClick={e => this.setState({ COUNT: this.state.COUNT + 1 })}>
Next Multiple
Expand Down

0 comments on commit 260d2bc

Please sign in to comment.