Preview

death penalty

Better Essays
Open Document
Open Document
798 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
death penalty
1.
#include
#include void main()
{
int a=5,b=6,c=11; clrscr(); printf("%d %d %d"); getch(); }

What will output when you compile and run the above code?

a) Garbage value garbage value garbage value
b) 5 6 11
c) 11 6 5
d) Compiler error

2.
#include

void main()
{
char *str="CQUESTIONBANK"; clrscr(); printf(str+9); getch(); }

What will output when you compile and run the above code?

(a)CQESTIONBANK
(b)CQUESTION
(c)BANK
(d)Compiler error

3.
#include
void main()
{
clrscr(); printf("%d",printf("CQUESTIONBANK")); getch();
}

What will output when you compile and run the above code?

(a)13CQUESTIONBANK
(b)CQUESTIONBANK13
(c)Garbage CQUESTIONBANK
(d)Compiler error

4.
#include
#include void main()
{
short int a=5; clrscr(); printf("%d"+1,a); getch(); }

What will output when you compile and run the above code?
(a)6
(b)51
(c)d
(d)Compiler error

5.
#include
void main()
{
int i=85; clrscr(); printf("%p %Fp",i,i); getch(); }

What will output when you compile and run the above code?

(a)85 85
(b)0055 034E:0055
(c)0055 FFFF:0055
(d)Compiler error

6.
#include
static struct student
{
int a; int b; int c; int d;
}s1={6,7,8,9},s2={4,3,2,1},s3;
void main()
{
s3=s1+s2; clrscr(); printf("%d %d %d %d",s3.a,s3.b,s3.c,s3.d); getch(); }
What will output when you compile and run the above code?
(a)6789
(b)4321
(c)10101010
(d)Compiler error

7.
#include
extern struct student
{
int a; int b; int c; int d;
}s={6,7,8,9};

void main()
{
clrscr(); printf("%d %d %d %d",s.a,s.b,s.c,s.d); getch(); }

What will output when you compile and run the above code?
(a)6789
(b)9876
(c)0000
(d)Compiler error

8.
#include
struct student
{
static int a; register int b; auto int c; extern int d;
}s={6,7,8,9};
void main()
{
printf("%d %d % %d",s.a,s.b,s.c,s.d);
}

What will output when you compile and run the above code?
(a)6789

You May Also Find These Documents Helpful

  • Satisfactory Essays

    = z) return true; else return false; } Problem 5 a. Output: 720 b. Output: 0 c. Output: 71 d. Output: 362880 Problem 6 a. Output: “Take Programming I.” b. Output:…

    • 188 Words
    • 1 Page
    Satisfactory Essays
  • Better Essays

    Nt1310 Unit 4

    • 3614 Words
    • 15 Pages

    The program is trying to collect the value of a "void" function into an integer variable.…

    • 3614 Words
    • 15 Pages
    Better Essays
  • Good Essays

    Nt1310 Unit 3 Quiz

    • 6337 Words
    • 26 Pages

    What is the primary purpose of the __P() macro? Choice 1 The __P() macro has no function, and merely obfuscates library function declarat ions. It should be removed from further releases of the C library. Choice 2 The __P() macro provides forward compatibility for C++ compilers, which do not r ecognize Standard C prototypes. Choice 3 Identifiers that begin with two underscores are reserved for C library implement ations. It is impossible to determine the purpose of the macro from the context given. Choice 4 The __P() macro provides backward compatibility for K&R C compilers, which do no t recognize Standard C prototypes. Choice 5 The __P() macro serves primarily to differentiate library functions from applica tion-specific functions. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /*question number 68*/ Which one of the following is NOT a valid identifier? Choice 1 __ident Choice 2 auto [Ans] Choice 3 bigNumber Choice 4 g42277 Choice 5 peaceful_in_space - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /*question number 69*/ /* Read an arbitrarily long string. */ Code: int read_long_string (const char ** const buf) { char * p = NULL; const char * fwd = NULL; size_t len = 0; assert(buf); do { p = realloc(p, len += 256); if (!p) return 0; if (!fwd) fwd = p; else fwd = strchr(p, '\0'); } while (fgets(fwd, 256, stdin)); *buf =…

    • 6337 Words
    • 26 Pages
    Good Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    21. Write a program that prompts the user to enter two unsigned numbers 0 to FFFFh and their sum in hex on the next line.…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    C++ programming: editing, compiling, user I/O, variables (ints, doubles, char, strings, booleans), loops, decisions, functions, pointers, arrays, tables, databases, sorting.…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Better Essays

    SAT Math Quiz

    • 2356 Words
    • 10 Pages

    and 2, then c + 1 is between 2 and 3. Any value for the…

    • 2356 Words
    • 10 Pages
    Better Essays
  • Powerful Essays

    It 210

    • 2960 Words
    • 12 Pages

    Although the value of a variable may change during execution of a program, in all our programs so far, a single value has been associated with each variable name at any given time. In this chapter, we will discuss the concept of an array—a collection of variables of the same type and referenced by the same name. We will discuss one-dimensional arrays (lists) at length and focus briefly on twodimensional arrays (tables). You will learn how to set up and use arrays to accomplish various tasks.…

    • 2960 Words
    • 12 Pages
    Powerful Essays
  • Good Essays

    It-250 Week 5 Questions

    • 397 Words
    • 2 Pages

    1. What function does every C program have? Why should you split large programs into several functions?…

    • 397 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Programming Homework

    • 366 Words
    • 2 Pages

    The variables in this program will be declared are num_1, num_2 and will be used as integers.…

    • 366 Words
    • 2 Pages
    Good Essays
  • Good Essays

    1. The logical structure in which one instruction occurs after another with no branching is a ______A______.…

    • 765 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    The expression 1 To 5 in the Case 1 To 5 clause specifies the range of numbers from ____.…

    • 595 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    E-Commerce Exercise

    • 1068 Words
    • 5 Pages

    3. The String class ____ method evaluates the contents of two String objects to determine if they are equivalent.…

    • 1068 Words
    • 5 Pages
    Better Essays
  • Good Essays

    death penalty

    • 470 Words
    • 2 Pages

    Specific deterrence- punishment of a crime that prevents the offender from repeating the same offense again.…

    • 470 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Death Penalty

    • 2559 Words
    • 11 Pages

    In his paper, “The Minimal Invasion Argument Against the Death Penalty”, Hugo Adam Bedau argues against the death penalty. Bedau’s purpose is to convince people to favor the lifetime imprisonment over the death penalty with an argument that had been previously used by other authors called “The minimal Invasion Argument”, which he considers to be “the best argument against the death penalty”(Bedau, 4). In this paper I will describe Bedau’s argument and show how he has some weaknesses addressing the concept of the minimal invasion argument by ignoring what in my opinion is the main reason why the death penalty has not been abolished; this reason being our incapacity as humans to “define” our environment. When we call one thing by a name we believe this thing is the name by which we have called it. For example when we call somebody a criminal we take away many of the characteristics that make us equal to the criminal and then just call him or her a criminal. With this essay I want to prove that in some cases as human beings we need to believe in re-definition, in change; all this in order to build a better society. To do this I will first explain Bedau’s argument as best as possible and then conclude with the issues I found on it that are based on our language as the interpreter of our world.…

    • 2559 Words
    • 11 Pages
    Powerful Essays
  • Powerful Essays

    death penalty

    • 1241 Words
    • 5 Pages

    Explanation of problem: Racial and gender disparities in death sentencing are not important enough to cast doubt on execution as a penalty for crime, however the numbers are astonishing. Death Sentencing: As you may know, the death penalty is often criticized for having a racial skew, and pages from the Death Penalty Information Center provide lots of data and reports on this front. One of many statistics on these pages I find notable is that out of roughly 1250 persons executed in the US in the modern era, more than 250 black defendants have been executed for killing white victims, but only 16 white defendants have been executed for killing back victims. Far less frequently discussed are the apparent gender disparities in the application of the death penalty in the United States, though this page from the Death Penalty Information Center and this report from Professor Victor Streib provides coverage of this issue. The data from these sources reveals that women account for about 10% of all murder arrests, but that women make up less than 2% of death rows (55 / 3,261) and less than 1% of those executed (12 / 1,250+). Indeed, in the last 8 years, nearly 450 men have been executed, while only 2 women have been executed (0.45%). Roughly speaking, when immigration offenses are excluded (because 90% involve hispanic offenders), the general population of federal defendants sentenced is about 1/3 white, 1/3 black and 1/3 hispanic. But for child porn offenses, the sentenced defendants are almost 90% white and only 3% black and 6% hispanic. Similarly, the general population of federal defendants sentenced is about 85% male and 15% female. But for child porn offenses, the sentenced defendants are over 99% male and less than 1% female. I feel that if you do the crime you get what you are sentenced to and each case is unique in and of itself and based on the circumstances you get what is coming to you.…

    • 1241 Words
    • 5 Pages
    Powerful Essays