GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

Write a logic that prints the following pattern (a diamond),…

Write a logic that prints the following pattern (a diamond), based on the input value for N. Concentrate on your loop logic, variables, and printf() statements. Hint: Each line has some spaces, and some *s; and each element is of width 3. For example, for N = 5: Row 1: Element-1, and element-2 are spaces (each of width 3, i.e., 3 spaces). Element-3 is a * (of width 3, i.e., a space, a *, and a space). Row 2: Element-1 is space, Element-2, Element-3, Element-4 are *. Row 3: Element-1, 2, 3, 4, and 5 are *s. Row 4: Repeat Row-2 logic. Row 5: Repeat Row-1 logic. Once you come up with a formula, the implementation should be a cakewalk.   If N = 3, it should print        *         *  *  *        *   If N = 5, it should print           *            *  *  *     *  *  *  *  *        *  *  *              *

Read Details

Given a matrix (2-D array) of elements, implement a logic to…

Given a matrix (2-D array) of elements, implement a logic to print the transpose of the matrix. Concentrate on your array logic, variables, and printf() statements. Assume the array is already declared and defined, and is of size SIZExSIZE. int array[][] = {{row of elements}, {row of elements}, … , {row of elements}}; Sample output: For example if array[][] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; The transpose of the matrix is: 1 4 7 2 5 8 3 6 9

Read Details

For this array: int a[  ] = { 0, 1, 2, 3, 4 } What is the le…

For this array: int a[  ] = { 0, 1, 2, 3, 4 } What is the length of this array?

Read Details

In Linux, what is the command to remove a file?

In Linux, what is the command to remove a file?

Read Details

In vim, in Command mode, what does the letter j do?

In vim, in Command mode, what does the letter j do?

Read Details

Given two strings st1[], and st2[], implement a logic to con…

Given two strings st1[], and st2[], implement a logic to concatenate the second string to the first string, without using the string.h library and it’s functions. Concentrate on your array logic, variables, and printf() statements. Assume both the strings are already declared and defined, and the size of input string is unknown. Sample output: For example, if st1[] = “Hello, How are you.” and st2[] = “Welcome to UTSA…” The concatenated string is: Hello, How are you. Welcome to UTSA…   Note: Only printing them side-by-side without concatenating, or using library string functions will give NO points.

Read Details

What statement is actually compiled if we use following prep…

What statement is actually compiled if we use following preprocessor directives? #define SCORE 3 + 4 int value = SCORE * 15;

Read Details

Which of the following statements are true about this array…

Which of the following statements are true about this array traversal code? int array[ 4 ] = { 35, 17, 28, 15 };int x; for( x = 0; x < 24; x++ ) {   printf( "%d\n", array[ x ] ); }

Read Details

Assume the name of your executable is myprogram. Which of th…

Assume the name of your executable is myprogram. Which of the following commands will execute the program?

Read Details

Predict the Output: printf(“%d”, sizeof(5.0)); printf(“%d”,…

Predict the Output: printf(“%d”, sizeof(5.0)); printf(“%d”, sizeof(5)); Explain what is printed and why? Consider the code is fully formed, i.e., no excuses like missing main(), missing stdio.h, etc.

Read Details

Posts pagination

Newer posts 1 … 43 44 45 46 47 … 79,323 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top