TRENDING NEWS

POPULAR NEWS

A Example Of A C Program Trivia Game That Ask 10 Question And Print Correct Or Incorrecrt After The

How do I randomise questions in C quiz program?

Copy paste the code I’ve written and run it. I’ve done for 3 questions. You can add more as per requirement. (you can also use goto but normally people try to avoid it)Refer to the link to know the real logic behind randomization: Sayantan Majumdar's answer to How do I generate random numbers without repetition in C?#include#include#include#include#include#include#includeint countr = 0;char menuController(){char ch1;system("cls");printf("\t\t\tC PROGRAM QUIZ GAME\n");printf("\n\t\t________________________________________");printf("\n\t\t\t WELCOME ");printf("\n\t\t\t to ");printf("\n\t\t\t THE GAME ");printf("\n\t\t________________________________________");printf("\n\t\t________________________________________");printf("\n\n\tDo you wish to start the Quiz? \n\tPress Y to start... \n\tPress any other key to exit...");ch1=getch(); //chereturn ch1;}void startQuiz(char name[]){printf("\n\n\n\t\t\tResister your name:");gets(name);}void runQuiz(){int i;bool arr[3]={0};int A[3];time_t t;srand((unsigned)time(&t));for(i=0; i<3; i++){int r = rand()%3;if(!arr[r])A[i]= r;elsei--;arr[r]=1;}for(i=0; i<3; i++){switch(A[i]){case 0:printf("\nWhich of this IDE is supported in Windows, Mac OS and Linux?");printf("\n\nA.Dev C++\t\tB.Code Blocks\n\nC.Eclipse\t\tD.C++ Builder");if (toupper(getch())=='C'){printf("\n\nCorrect!!!");countr++;getch();break;}else{printf("\n\nWrong!!! The correct answer is C. Eclipse");getch();break;}case 1:printf("\nWhich of this is not a Token?");printf("\n\nA.Keywords\t\tB.Include\n\nC.Identifiers\t\tD.Literals");if (toupper(getch())=='B'){printf("\n\nCorrect!!!");countr++;getch();break;}else{printf("\n\nWrong!!! The correct answer is B. Include");getch();break;}case 2:printf("\nWhich of this is not a fundamental data type?");printf("\n\nA.Array\t\http://tB.Int\n\nC.Char\t\tD.Double");if (toupper(getch())=='A'){printf("\n\nCorrect!!!");countr++;getch();break;}else{printf("\n\nWrong!!! The correct answer is A. Array");getch();break;}}}}void displayResult(){printf("Your score is = %d", countr);}int main(){char ch1, name[20];ch1 = menuController();if(ch1=='Y'){system("cls");startQuiz(name);printf("\nWELCOME %s! LET US BEGIN THE GAME!", name);runQuiz();displayResult();}}

What does an expression involving multiple post/pre decrement/increment operators evaluate to in C and C++?

A2AThe answer from Sergey Zubkov is most correct.Specifically, in the C standard in section 5.1.2.3, paragraph 3, it clearly states that the expression is unsequenced.The important part of this is covered in note 13:ISO/IEC 9899:201xThe executions of unsequenced evaluations can interleave. Indeterminately sequenced evaluations cannot interleave, but can be executed in any order.Sequence points are described in detail in the C standard, in the informational section in annex C, located at the end of the standards document.Because the values are computed without being ordered before the addition, the value will be anywhere between 18 and 24, depending on the compiler being used, and the option flags — primarily those controlling code optimization.It should be noted that Turbo-C has not been actively developed since 1990 — more than a quarter of a century ago — and even their web site calls it antique software: Antique Software: Turbo C version 2.01.While this won’t change the answers regarding sequence points, it does mean that the compiler is grossly out of date, and its behaviour should not be take as being standards compliant for more modern standards.

Which kind of coding questions are being asked in the TCS 2018 placements?

TCS has revised Exams pattern by introducing 2 more section in written exam i.e. Technical MCQ’s on C language and Coding, and updated the Quantitative Ability section where candidates need to answers 20 questions in 40 minutes. In MCQs candidates can get some 2 ** questions (carry more marks), each section will have negative marking, so candidates need to mark answers carefully.Coding Test: This new section added in TCS new pattern 2018 Exam, where candidates have to solve 1 programming question in 20 minutes, in C Programming using an inbuilt online compiler. Mostly question will be some Basics/standard C programming using COMMAND LINE ARGUMENTS.Practice all the basics program using command line like GCD/HCF, LCM, factorial, Fibonacci series, string programs (reverse/search/replace etc.), sum of number, even/odd, leap year etc.Practice all the questions asked in this section: Programs asked in “TCS Coding Test” of Q4I programming section.Other Useful link related to TCS:TCS Online Mock Test Based on new pattern:TCS Online Test TCS Online Aptitude Test TCS Online Mock Test freeTCS Email Writing Topics:TCS Email Writing Email Writing Test Questions with Answers Online Email Writing Test For ExamsTCS Command Line Programs:C C++ Java Data structure basic program IBM Wipro Capgemini CTS TCs | Q4Interview.comTCS Technical Round Interview Q&ATCS Technical Interview Questions TCS Interview Questions for ExperiencedTCS HR Round Q&ATCS HR Questions for Freshers HR Interview Questions of TCS HR QuestionsTCS Questions with Answers for Practice:TCS model papers for freshers TCS online test questionsTCS Placement Paper & Experience:TCS Online Test Question Papers TCS Practice Test TCS Question Papers

If I mark all answers 'C' in an MCQ (Multiple Choice Questions) exam, what is the probability of passing the exam?

This question touches on the over-all strategy of “testmanship,” which applies a generic answer strategy in addition to whatever knowledge of the subject matter you actually have.This assumes the MCQ you face is relevant to some course of study you are involved with, or some area of knowledge with which you have a working familiarity -but no special expertise.Here’s the over-all approach:Before you start answering, scan the whole test to get an indication of the questioning strategy. Do not assume you must answer the questions in order -unless that’s a test condition.Go ahead and answer the questions where you have a good degree of confidence that you know the answer. Those are your “gimmies.” Let us say that this gives you 25% of the test.Now scan the questions for choices which you know or strongly suspect to be wrong. The more questions with wrong answers, the better, because your actual odds of a correct answer will be between the “possible” answers. If you’ve narrowed it down to two, then your odds on a sheer guess or coin flip are 50–50. Let us suppose that such questions account for half of the test. If so, you pick up another 25% or thereabouts. But don’t guess randomly -make an effort to determine which choice is more probably correct. That give you a slight edge.That leaves 25% of the test which have few or no known wrong answers. In a 4 choice test, your odds on a guess are 25%. Again, use what you DO know to get an edge.Watch out for answers such as “neither A nor D” or “Both C and B.” Hit the BOTH answers first, for any question where you have ruled out at least one answer.Be aware that the wording of some questions may give you a strong clue as to the answer to a subsequent question.Ignore suspicious patterns to answers, such as “all the answers are “B.”In general, apply the above instructions in the order they are given. The idea is to grab the low-hanging fruit first, then work your way up the “tree,” to more difficult material.This website: General knowledge quizzes has many MCQ’s in various areas where you may practice. In a general knowledge test I just took, I scored 9 out of 10 correct, using the strategies above. There were 2 questions which included known wrong answers, improving my odds on a “guess.” There were 2 on which I was completely clueless.Bottom line: some knowledge of subject matter is essential, but knowing how to take the test can be critical.Hope that helps.

TRENDING NEWS