The % symbol has a special use in a print statement. Define How would you place this character as part of the output on the screen?

1 Answer

Answer :

You can do this by using %% in the printf statement. For example, you can write printf(“10%%”) to have the output appear as 10% on the screen.

Related questions

Description : Define what is the difference between single character constant and string constant?

Last Answer : A single character constant consists of only one character and it is enclosed within a pair of single quotes. A string constant consists of one or more characters and it is enclosed within a pair of double quotes.

Description : Define what is character set?

Last Answer : A character set is the set of characters allowed and supported in the programming language. Generally, a program is a collection of instructions, which contain groups of characters. Only a limited set of characters is allowed to write instructions in the program.

Description : Define what is output redirection?

Last Answer : It is the process of transferring data to an alternative output source other than the display screen. Output redirection allows a program to have its output saved to a file. For example, if you have ... then have the output redirected to a file named DATA, instead of define Howing it on the screen.

Description : Define what is the use of a semicolon (;) at the end of every program statement?

Last Answer : It has to do with the parsing process and compilation of the code. A semicolon acts as a delimiter so that the compiler knows where each statement ends and can proceed to divide the statement into smaller elements for syntax checking.

Description : In a switch statement, Define what will happen if a break statement is omitted?

Last Answer : If a break statement was not placed at the end of a particular case portion? It will move on to the next case portion, possibly causing incorrect output.

Description : Define what is wrong with this program statement? void = 10;

Last Answer : The word void is a reserved word in C language. You cannot use reserved words as a user-defined variable.

Description : Define what is break statement?

Last Answer : When a break is encountered inside a loop, the loop is terminated and the control passes to the statement following the body of the loop.

Description : Do these two program statements perform the same output?

Last Answer : 1) scanf(“%c”, &letter); 2) letter=getchar() Yes, they both do the exact same thing, which is to accept the next key pressed by the user and assign it to the variable named letter.

Description : Define what do the characters “r” and “w” mean when writing programs that will make use of files?

Last Answer : “r” means “read” and will open a file as input wherein data is to be retrieved. “w” means “write”, and will open a file for output. Previous data that was stored on that file will be erased.

Description : Define what is the use of getchar() function?

Last Answer : It returns a character just entered from the standard input unit, that is, keyboard. The entered character can be either assigned to a character variable or echoed to the computer screen.

Description : Define what is the use of typedef?

Last Answer : The typedef help in easier modification when the programs are ported to another machine. A descriptive new name given to the existing data type may be easier to understand the code.

Description : Define How do you convert strings to numbers in C?

Last Answer : You can write your own functions to do string to number conversions, or instead use C’s built-in functions. You can use to convert to a floating point value, atoi to convert to an integer value, and atol to convert to a long integer value.

Description : Define what are the advantages and disadvantages of a heap?

Last Answer : Storing data on the heap is slower than it would take when using the stack. Define, However, the main advantage of using the heap is its flexibility. That's because the memory in this ... particular order. Slowness in the heap can be compensated if an algorithm was well designed and implemented.

Description : Define How do you search for data in a data file using the random access method?

Last Answer : Use the fseek() function to perform random access input/output on a file. After the file was opened by the fopen() function, the fseek would require three parameters to work: a file pointer to the file, the number of bytes to search, and the point of origin in the file.

Description : Define what is gets() function?

Last Answer : The gets() function allows a full line data entry from the user. When the user presses the enter key to end the input, the entire line of characters is stored to a string variable. Note that ... key is not included in the variable, but instead, a null terminator is placed after the last character.

Description : Define what are pointers?

Last Answer : Pointers point to specific areas in the memory. Pointers contain the address of a variable, which in turn may contain a value or even an address to another memory.

Description : Describe Define How arrays can be passed to a user defined function?

Last Answer : One thing to note is that you cannot pass the entire array to a function. Instead, you pass to it a pointer that will point to the array first element in memory. To do this, you indicate the name of the array without the brackets.

Description : Define what is the advantage of a random access file?

Last Answer : If the amount of data stored in a file is fairly large, the use of random access will allow you to search through it quicker. If it had been a sequential access file, you would have to go ... the target data. A random access file lets you jump directly to the target address where data is located.

Description : Define what is the general form of a C program?

Last Answer : A C program begins with the preprocessor directives, in which the programmer would specify which header file and Define what constants (if any) to be used. This is followed by the main function heading. Within the main function lies the variable declaration and program statement.

Description : Define what are the different data types in C?

Last Answer : The basic data types are int, char, and float. Int is used to declare variables that will be storing integer values. Float is used to store real numbers. Char can store individual character values.

Description : Define what is dynamic data structure?

Last Answer : Dynamic data structure provides a means for storing data more efficiently into memory. Using dynamic memory allocation, your program will access memory spaces as needed. This is in contrast to a static data ... the programmer has to indicate a fixed number of memory space to be used in the program.

Description : Define what is the difference between text files and binary files?

Last Answer : Text files contain data that can easily be understood by humans. It includes letters, numbers and other characters. On the other hand, binary files contain 1s and 0s that only computers can interpret.

Description : Define what are structure types in C?

Last Answer : Structure types are primarily used to store records. A record is made up of related fields. This makes it easier to organize a group of related data.

Description : Define what is the difference between functions get() and getche()?

Last Answer : Both functions will accept a character input value from the user. When using getch(), the key that was pressed will not appear on the screen and is automatically captured and assigned to a variable. When ... by the user will appear on the screen, while at the same time being assigned to a variable.

Description : Define what are multidimensional arrays?

Last Answer : Multidimensional arrays are capable of storing data in a two or more dimensional structure. For example, you can use a 2-dimensional array to store the current position of pieces in a chess game, or position of players in a tic-tac-toe program.

Description : Define what does the function to upper() do?

Last Answer : It is used to convert any letter to its upper case mode. Tupper() function prototype is declared in . Note that this function will only convert a single character and not an entire string.

Description : Define what are enumerated types?

Last Answer : Enumerated types allow the programmer to use more meaningful words as values to a variable. Each item in the enumerated type variable is actually associated with a numeric code. For example, one can create an enumerated type variable named DAYS whose values are Monday, Tuesday… Sunday.

Description : Define what are global variables and Define How do you declare them?

Last Answer : Global variables are variables that can be accessed and manipulated anywhere in the program. To make a variable global, place the variable declaration on the upper portion of the program, just after the preprocessor directives section.

Description : Define what are control structures?

Last Answer : Control structures take charge at which instructions are to be performed in a program. This means that program flow may not necessarily move from one statement to the next one, but rather some ... need to be pass into or bypassed from, depending on the outcome of the conditional statements.

Description : Define what are formal parameters?

Last Answer : In using functions in a C program, formal parameters contain the values that were passed by the calling function. The values are substituted in these formal parameters and used to Define whatever operations as indicated within the main body of the called function.

Description : Define what is the difference between functions abs() and fabs()?

Last Answer : These 2 functions basically perform the same action, which is to get the absolute value of the given value. Abs() is used for integer values, while fabs() is used for floating type numbers. Also, the prototype for abs() is under , while fabs() is under .

Description : Define what are run-time errors?

Last Answer : These are errors that occur while the program is being executed. One common instance wherein run-time errors can happen is when you are trying to divide a number by zero. When run-time errors occur, program execution will pause, define Howling which program line caused the error.

Description : Define what is a newline escape sequence?

Last Answer : A newline escape sequence is represented by the character. This is used to insert a new line when displaying data in the output screen. More spaces can be added by inserting more n characters ... insert two spaces. A newline escape sequence can be placed before the actual output expression or after.

Description : Define what are actual arguments?

Last Answer : When you create and use functions that need to perform an action on some given values, you need to pass these given values to that function. The values that are being passed into the called function are referred to as actual arguments.

Description : Define what is a program flowchart and Define How does it help in writing a program?

Last Answer : A flowchart provides a visual representation of the step by step procedure towards solving a given problem. Flowcharts are made of symbols, with each symbol in the form of different shapes. Each shape ... the entire program structure, such as a process, a condition, or even an input/output phase.

Description : Define what is an endless loop?

Last Answer : An endless loop can mean two things. One is that it was designed to loop continuously until the condition within the loop is met, after which a break function would cause the program to ... , causing the loop to run erroneously forever. Endless loops are oftentimes referred to as infinite loops.

Description : Define what would happen to X in this expression: X += 15;

Last Answer : (assuming the value of X is 5) X +=15 is a short method of writing X = X + 15, so if the initial value of X is 5, then 5 + 15 = 20.

Description : Define what is the difference between the expression “++a” and “a++”?

Last Answer : In the first expression, the increment would happen first on variable a, and the resulting value will be the one to be used. This is also known as a prefix increment. In the second expression, ... in an operation, before the value of itself is incremented. This is also known as postfix increment.

Description : Define what are binary trees?

Last Answer : Binary trees are actually an extension of the concept of linked lists. A binary tree has two pointers, a left one and a right one. Each side can further branch to form additional nodes, which each node having two pointers as well.

Description : Define what is FIFO?

Last Answer : In C programming, there is a data structure known as a queue. In this structure, data is stored and accessed using FIFO format, or /First-In-First-Out/. A queue represents a line wherein the first data that was stored will be the first one that is accessible as well.

Description : Define what is linked list?

Last Answer : A linked list is composed of nodes that are connected with another. In C programming, linked lists are created using pointers. Using linked lists is one efficient way of utilizing memory for storage.

Description : Define what are reserved words?

Last Answer : Reserved words are words that are part of the standard C language library. This means that reserved words have special meaning and therefore cannot be used for purposes other than Define what it is originally intended for. Examples of reserved words are int, void, and return.

Description : Define what is friend function?

Last Answer : The function declaration should be preceded by the keyword friend. The function definitions do not use either the keyword or the scope operator::. The functions that are declared with the keyword friend ... function. Thus, a friend function is an ordinary function or a member of another class.

Description : Define what are the types of data types and explain?

Last Answer : There are five basic Data types in C. These are : void: means nothing i.e. no data involvement in an action char: to work with all types of characters used in computer operations int ... the exponential form double: to work with double precision of numbers when the an approximation is very crucial.

Description : Define what is a loop?

Last Answer : A loop is a process to do a job repeatedly with possibly different data each time. The statements executed each time constitute the loop body, and each pass is called iteration. A condition must be present to terminate the loop.

Description : Define what is zero-based addressing?

Last Answer : The array subscripts always start at zero. The compiler makes use of subscript values to identify the elements in the array. Since subscripts start at 0, it is said that the array uses zero-based addressing.

Description : Define what is this pointer?

Last Answer : It is a pointer that points to the current object. This can be used to access the members of the current object with the help of the arrow operator

Description : Define what are the different categories of functions in C?

Last Answer : In C, the functions can be divided into the following categories : 1. Functions with no arguments and no return values 2. Functions having arguments but no return values 3. Functions having arguments and return values also

Description : Define what is signed and unsigned?

Last Answer : A numeric value may have a positive or negative sign. In the memory, for a variable, one bit is used exclusively to maintain the sign of the data. If we don’t have a sign, the sign bit also may be used for data. If the value is negative, the sign bit is 1, and if it is positive, it will be 0.

Description : Define what is masking?

Last Answer : Masking is a process in which a given bit pattern is partly extracted into another bit pattern by means of a logical bitwise operation.