-
-
Save ShoaibKakal/ce7dac6445ad6dc22b9384d8b401f4d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.16; | |
contract Quiz{ | |
struct Question{ | |
string statement; | |
bool isTrue; | |
} | |
Question[] questions; | |
constructor() payable{ | |
addQuestions(); | |
} | |
function addQuestions()public payable{ | |
questions.push(Question("Gen. Bajwa is the CEO of Pakistan?", true)); | |
questions.push(Question("Firebase was acquired by google in 2013",false)); | |
questions.push(Question("Bitcoin is an application of Blockchain", true)); | |
questions.push(Question("Smart contract removes intermediaries", true)); | |
} | |
function getQuestions()public view returns(Question[] memory){ | |
return questions; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment