c programming
What is a C language variable?
Select an answer:
a number or single character
the result of an assignment expression
a constant value that can change
a container for a type of data
2)
Where is a good spot to insert the newline escape sequence?
Select an answer:
After the backslash character.
At the end of the printf() statement, because printf() doesn't automatically append a newline.
Anywhere in a string you want a new line of text to appear.
After the semicolon at the end of a statement.
3)
Beyond documenting your code, how else can comments be used?
Select an answer:
You can comment out part of the code.
They can be used for pretty decorations.
They can help link other source code files without compiling them directly.
You can offer instructions to the precompiler.
4)
C language statements end with a _____.
Select an answer:
period
semicolon
Enter key press (newline)
set of curly brackets or braces
5)
What is the advantage of an IDE?
Select an answer:
The IDE offers a fancy editor with highlighting and other useful features.
It provides a central location for all programming activities.
The IDE helps compile and link your code.
The IDE is best used for larger projects or when you need to debug your code.
1) a container for type of data
Explanation:
Variable in C is a container for type of data.
Each variable in C has a specific data type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable.
| s.no | Type & Description |
| 1 |
char Typically a single octet(one byte). This is an char type. |
| 2 |
int The most natural size of integer for the machine.this is an integer type |
| 3 |
float A single-precision floating point value. |
| 4 |
double A double-precision floating point value. |
| 5 |
void Represents the absence of type. |
2) at the end of printf() statement ,because printf() statement doesn't automatically adds a new line
Explanation:
"\n" is used to add or append a new line at the end of printf() statement.
3) you can comment out part of the code
Explanation:
two types of comments are available in c
single line comment starts with // .
multi line comments starts and ends with /*..............*/
4) semicolon
Explanation:
C language statements end with a ; as a terminator for each statement.
5) idea helps to compile and link your code
Explanation:
IDE has built-in compiler and linker, which can be invoked with clicks from IDE
// Code to copy
// demo c program
#include<stdio.h>
int main(){
// single line commnet
int n;
n=10;
char ch;
ch='A';
/* printing
integer type
char type variables using new line character*/
printf("%d\n",n);
printf("%c",ch);
return 0;
}
c programming What is a C language variable? Select an answer: a number or single character...
C programming 1) When setting a two-dimensional character array, how is the size (number of characters) in the second dimension set? Select an answer: The number of elements are equal to the average size of all the strings. To the length of the longest string; you don't need to add one because the first array element is zero. To the length of the longest string, plus one for the null character. The second dimension is equal to the number of...
Hi everyone, I have a problem about C programming.
Background Material:
The figure 6 is as below:
The task:
Download the file 55.c. Study the C code, then build an
executable and run it to see what the output is. Modify the program
so that the output is The string in buffer is "In C the value of 12
+ 34 / 5 is 18." Do this by looking up decimal values for ASCII
codes in Figure 6 and typing...
Using Unix/Linux Command line in terminal and C programming. (b) Write a basic C program contained in a1q4.c and perform the following tasks in your program’s main() function: (8 marks) • Declare and initialize at least one variable of these types: char, int, unsigned int, float, double and long double. When initializing your variables, ensure the constants you use are of the same type as your variable. See the “Constants” section of Topic 7 for more information. • Use printf(3)...
Please Do it In Java: Objectives: To Java programming language To understand the lexical analysis phase of program compilation Assignment: The first phase of compilation is called scanning or lexical analysis. This phase interprets the input program as a sequence of characters and produces a sequence of tokens, which will be used by the parser. Write a Java, program that implements a simple scanner for a source file given as a command-line argument. The format of the tokens is described...
Write in C
Spring 2016 Lab Assignment 11 ET2100 In computer programming in general a "string" is a sequence of characters. In the C language anything within double quotes is a "string constant" so you have been seeing strings all semester. But we can also have string variables. In the C language these are implemented as an array of char, e.g. char name (10]: In order to make these variables easier to work with, it has been universally agreed that...
‘C’ programming language question Write a MENU DRIVEN program to A) Count the number of vowels in the string B) Count the number of consonants in the string C) Convert the string to uppercase D) Convert the string to lowercase E) Display the current string X) Exit the program The program should start with a user prompt to enter a string, and let them type it in. Then the menu would be displayed. User may enter option in small case...
please write it in c++ programming language
this is the rat text file
More what? what more additional information do you want? so i can
provide it.
Write a program that reads files and prepares an statistical summary for each file processed with the following information: • total number of words in the report; • number of unique words: • number of unique words of more than four letters; Input From the keyboard: 1. The name of the files containing...
Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....
C programming is the main one and pick another code of choice!!! Background This assignment is based on one of the Big Ideas in this course, namely that reading C source code is a real aid in learning how to write C code. To that end, in this project, you write a program that scans C source from the 'Net and calculates some simple statistics. We're learning lots of concepts, and by running the program you write here on several...