Preview

C QUESTIONS & ANSWERS

Good Essays
Open Document
Open Document
604 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
C QUESTIONS & ANSWERS
CODING - DEBUGGING PRELIMS ROUND QUIZ
PART—ONE (PREDICT THE OUTPUT)
Q1. What will be the output of the following arithmetic expression?
5+3*2%10-8*6
a) -37(Y)
b) -42
c) -32
d) -28

Q2. What will be the output of the following statement?
Printf (3 + "goodbye");
A) goodbye
B) odbye
C) bye
D) dbye(Y)

Q3. What will be the output of the following statements? int x[4] = {1,2,3}; printf("%d %d %D",x[3],x[2],x[1]);
a) 03%D
b) 000
c) 032(Y)
d) 321

Q4). Predict the Output? void main ()
{
int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); }
}
What is the output?
1) XAM is printed
2) exam is printed
3) Compiler Error
4) Nothing is printed(Y)

Q5. What will be the output of the following statements? int i = 3; printf("%d%d",i,i++); a) 34(Y)
b) 43
c) 44
d) 33

Q6). long factorial (long x)
{
???? return x * factorial(x - 1);
}
With what do you replace the ???? to make the function shown above return the correct answer?
1)
if (x == 0) return 0;
2)
return 1;
3)
if (x >= 2) return 2;
4)
if (x <= 1) return 1;(Y)

Q7.What will be the output of the program?
#include<stdio.h>
int main()
{
typedef int LONG; LONG a=4; LONG b=68; float c=0; c=b; b+=a; printf("%d,", b); printf("%f\n", c); return 0;
}
A. 72, 68.000000 (Y)
B. 72.000000, 68
C. 68.000000, 72.000000
D. 68, 72.000000

Q8.What will be the output of the program?
#include<stdio.h>
int main()
{
float a = 0.7; if(0.7 > a) printf("Hi\n"); else printf("Hello\n"); return 0;
}
A. Hi(Y) B. Hello C. Hi Hello D. None of above

Q9.What will be output of the following c program? #include<stdio.h> int main(){ int max-val=100; int min-val=10; int avg-val; avg-val = max-val + min-val / 2; printf("%d",avg-val); return 0;
}
A) 55
B) 105
C) 60
D) Compilation error(y)

Q10.What will be the output of the program?
#include<stdio.h>
#include<stdlib.h> int main()
{
int i=0; i++; if(i<=5) {

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Enter the appropriate numbers/formulas in the shaded (gray) cells. An asterisk (*) will appear to the right of an incorrect answer.…

    • 718 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Enter the appropriate numbers/formulas in the shaded (gray) cells. An asterisk (*) will appear to the right of an incorrect answer.…

    • 301 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Sample Exam 1 Questions

    • 973 Words
    • 4 Pages

    3. Christopher's lunch contains 121 grams of carbohydrate, 40 grams of protein, and 25 grams of fat. What percent of kilocalories in this meal come from fat?…

    • 973 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Ucc Questions

    • 929 Words
    • 4 Pages

    Uniform Commercial Code, The Uniform Commercial Code represents a general and comprehensive revision of the state's prior laws applicable to commercial transactions.…

    • 929 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    C3 Coursework

    • 2611 Words
    • 11 Pages

    In this coursework I am going to investigate numerical methods of solving equations. The methods I will use are:…

    • 2611 Words
    • 11 Pages
    Good Essays
  • Satisfactory Essays

    This exam consists of 20 questions of equal value on a total of 4 pages including this cover page.…

    • 746 Words
    • 10 Pages
    Satisfactory Essays
  • Powerful Essays

    50 NCLEX Q S EXAM 2

    • 3243 Words
    • 13 Pages

    1.
The nurse is preparing to teach the patient about maintaining his health. Which whole medical system would best aid the nurse in guiding the patient?…

    • 3243 Words
    • 13 Pages
    Powerful Essays
  • Satisfactory Essays

    1.The summer soldier and the sunshine patriot will shrink from the service of his country during crisis.…

    • 338 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    1) The “iron curtain” was a dividing line because it was dividing Eastern and Western Europe. Western Europe had more of a democratic form of government where as Eastern Europe was ruled by the Soviet Union.…

    • 1198 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    C200 Exam

    • 1410 Words
    • 6 Pages

    1. In President Obama’s speech at West Point, he announced that 30,000 additional troops would be sent to Afghanistan. He made this decision because he said it was vital to the United States’ national interest. The vital national interest at risk in President Obama’s address is the security and safety of the American people as well as the “security of our allies and the common security of the world.” By involving the military and increasing the troop strength, President Obama can achieve the objectives of his strategy. His objectives are to keep the Taliban from becoming powerful, prevent them from government rule, improve Afghanistan security forces and government so they can manage their own country and prevent Al Qaeda from establishing refuge in other countries. If you follow the framework of several important U.S. documents, such as the National Defense Strategy (NDS) and Quadrennial Defense Review (QDR) they will outline this same strategy. The National Defense Strategy states that it is the responsibility of the military to protect ourselves and our allies from attack. It states that the military should help protect and secure our vital interests abroad. U.S. security is linked with the security of the international community. The physical integrity of our country is protected by the military through multiple security controls. One of these security controls is through deployments of the armed forces. The Quadrennial Defense Review states the mission of the U.S. military is to protect the American people and advance our nation’s interests. The vital interests of the United States are intertwined with the integrity and resilience of allies abroad. Our vital interests are security, prosperity, broad respect for universal values and an international order that promotes cooperation among our allies. The President’s vision is to become more powerful domestically while bringing together all elements of national power. We need to help our neighbors…

    • 1410 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    Re: Group C Discussion

    • 724 Words
    • 3 Pages

    The watercooler has become a symbol in business life. It, or any common gathering place in an office slightly removed from the cubicles and desks, is a place to share information, both casual and vital, and to build networks with colleagues you don't necessarily see or interact with every day. The Watercooler activities throughout this course and program will help you get into the practice of looking beyond your metaphorical cubicle to seek out topical news stories and ideas and analyze them with your instructor and colleagues. Familiarity with current trends, topics, and events is an important element of your participation and success in the business world.…

    • 724 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    When acting on suspicion on abuse you need to be fully aware that is isn’t going to harm the victim even more so. But you do need report this in my case I would report to my senior, nurse, and manger and if I still wasn’t satisfied then I would report this on to social services, safeguarding and CQC. I would make my report in written and date this and keep a copy for evidence. If the report was against an employee or family I would ensure in the meantime that the victim was in a safe environment.…

    • 1855 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    • It is important to work with other as we have a common goal to protect from harm. To ensure we are all involved in decision making to contribute to the growth and development of the whole team.…

    • 770 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    GCSE Questions

    • 1462 Words
    • 8 Pages

    (e) [12 marks] Discuss this statement. You should include different, supported points of views and a personal viewpoint. You must refer to Christianity in your answer.…

    • 1462 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    Quiz 1 Study Guide

    • 484 Words
    • 4 Pages

    Quiz 1 covers chapters 1, 2, 4, and 5 in Doweiko (2015). It is highly suggested that as you use this study guide, you write down page numbers and details on this study guide as well as highlight information in your text so you can more readily find the details you’re looking for when taking the test. The quizzes are open-book, open-notes. You will have 1 hour to complete the 25 items. Below are topics in each chapter that you will want to study for the quiz.…

    • 484 Words
    • 4 Pages
    Satisfactory Essays

Related Topics