A Program Layout
In the previous article, we met the following program:
main()
{
printf("Welcome to C Programming");
}
C does not require the program to be laid out as in the example. An equivalent program is
#include <stdio.h>
main()
{
printf("Welcome to C Programming"); }
or
#include <stdio.h>
main() {
printf("Welcome to C Programming"); }
All that matters is that the order of the words and punctuation is maintained. For this small program, it probably does not matter which version we use. However, as program size increases, it becomes imperative that the layout of the program highlights the logical structure of the program.
This improves its readability and makes it easier to understand. Indentation and clearly indicating which { matches which } can help in this regard. We will see the value of this principle as our programs become more substantial.
Writing output with printf
Suppose we want to write a program to print the lines (from The Gitanjali by Rabindranath Tagore):
Where the mind is without fear
And the head is held high
Our initial attempt might be:
#include <stdio.h>
main() {
printf("Where the mind is without fear");
printf("And the head is held high");
}
However, when run, this program would print:
Where the mind is without fearAnd the head is held high
Note that the two strings are joined together (we say the strings are concatenated). This happens because printf does not place output on a new line, unless this is specified explicitly. Put another way, printf does not automatically supply a newline character after printing its argument(s). A newline character would cause subsequent output to begin at the left margin of the next line.
In the example, a newline character is not supplied after fear is printed so that And the head... is printed on the same line as fear and immediately after it.
The newline character, \n
To get the desired effect, we must tell printf to supply a newline character after printing ...without fear. We do this by using the character sequence \n (backslash n) as in the following:
#include <stdio.h>
main()
{
printf("Well-Come in the field of C Programming\n");
printf("Where the mind is without fear\n");
printf("And the head is held high\n");
}
The first \n says to terminate the current output line; subsequent output will start at the left margin of the next line. Thus, And the... will be printed on a new line. The second and third \n has the effect of terminating the second line. If it were not present, the output will still come out right, but only because this is the last line of output. A program prints all pending output just before it ends.
onlineeducation
Thursday, November 25, 2010
Monday, November 22, 2010
Data & Variables
Data and Variables
All computer programs, except the most trivial, are written to operate on data. For example:
• the data for an action game might be keys pressed or the position of the cursor when the mouse is clicked;
• the data for a word processing program are the keys pressed while you are typing a letter;
• the data for an accounting program would include, among other things, expenses and income;
• the data for a program that teaches Spanish could be an English word that you type in response to a question.
For a program to be run, it must be stored in the computer’s memory. When data is supplied to a program, that data is also stored in memory. Thus we think of memory as a place for holding programs and data. One of the nice things about programming in a high-level language (like C or Java) is that you don’t have to worry about which memory locations are used to store your data. But how do we refer to an item of data, given that there may be many data items in memory?
Think of memory as a set of boxes (or storage locations). Each box can hold one item of data, for example, one number. We can give a name to a box, and we will be able to refer to that box by the given name. In our example, we will need two boxes, one to hold the side of the square and one to hold the area. We will call these boxes s and a, respectively.
If we wish, we can change the value in a box at any time; since the values can vary, s and a are called variable names, or simply variables. Thus a variable is a name associated with a particular memory location or, if you wish, it is a label for the memory location. We can speak of giving a variable a value, or setting a variable to a specific value, such as 1, for instance. Important points to remember are:
• a box can hold only one value at a time; if we put in a new value, the old one is lost;
• we must not assume that a box contains any value unless we specifically store a value in the box. In particular, we must not assume that the box contains 0.
Variables are a common feature of computer programs. It is very difficult to imagine what programming would be like without them. In everyday life, we often use variables. For example, we speak of an ‘address’. Here, ‘address’ is a variable whose value depends on the person under consideration. Other common variables are telephone number, name of school, subject, size of population, type of car, television model, etc. (What are some possible values of these variables?)
Now that we know a little bit about variables, we are ready to develop the algorithm for calculating the area of a square.
• the data for an action game might be keys pressed or the position of the cursor when the mouse is clicked;
• the data for a word processing program are the keys pressed while you are typing a letter;
• the data for an accounting program would include, among other things, expenses and income;
• the data for a program that teaches Spanish could be an English word that you type in response to a question.
For a program to be run, it must be stored in the computer’s memory. When data is supplied to a program, that data is also stored in memory. Thus we think of memory as a place for holding programs and data. One of the nice things about programming in a high-level language (like C or Java) is that you don’t have to worry about which memory locations are used to store your data. But how do we refer to an item of data, given that there may be many data items in memory?
Think of memory as a set of boxes (or storage locations). Each box can hold one item of data, for example, one number. We can give a name to a box, and we will be able to refer to that box by the given name. In our example, we will need two boxes, one to hold the side of the square and one to hold the area. We will call these boxes s and a, respectively.
If we wish, we can change the value in a box at any time; since the values can vary, s and a are called variable names, or simply variables. Thus a variable is a name associated with a particular memory location or, if you wish, it is a label for the memory location. We can speak of giving a variable a value, or setting a variable to a specific value, such as 1, for instance. Important points to remember are:
• a box can hold only one value at a time; if we put in a new value, the old one is lost;
• we must not assume that a box contains any value unless we specifically store a value in the box. In particular, we must not assume that the box contains 0.
Variables are a common feature of computer programs. It is very difficult to imagine what programming would be like without them. In everyday life, we often use variables. For example, we speak of an ‘address’. Here, ‘address’ is a variable whose value depends on the person under consideration. Other common variables are telephone number, name of school, subject, size of population, type of car, television model, etc. (What are some possible values of these variables?)
Now that we know a little bit about variables, we are ready to develop the algorithm for calculating the area of a square.
Develop the Algorithm
Using the notion of an algorithm and the concept of a variable, we develop the following algorithm for calculating the area of a square, given one side:
Algorithm for calculating area of square, given one side
(1) Ask the user for the length of a side
(2) Store the value in the box s
(3) Calculate the area of the square (s times s)
(4) Store the area in the box a
(5) Print the value in box a, appropriately labelled
(6) Stop
When an algorithm is developed, it must be checked to make sure that it is doing its intended job correctly. We can test an algorithm by ‘playing computer,' that is, we execute the instructions by hand, using appropriate data values. This process is called dry running or desk checking the algorithm. It is used to pinpoint any errors in logic before the computer program is actually written. We should never start to write programming code unless we are confident that the algorithm is correct. Here, the algorithm is fairly simple, so it is easy to check that it is indeed correct.
Algorithm for calculating area of square, given one side
(1) Ask the user for the length of a side
(2) Store the value in the box s
(3) Calculate the area of the square (s times s)
(4) Store the area in the box a
(5) Print the value in box a, appropriately labelled
(6) Stop
When an algorithm is developed, it must be checked to make sure that it is doing its intended job correctly. We can test an algorithm by ‘playing computer,' that is, we execute the instructions by hand, using appropriate data values. This process is called dry running or desk checking the algorithm. It is used to pinpoint any errors in logic before the computer program is actually written. We should never start to write programming code unless we are confident that the algorithm is correct. Here, the algorithm is fairly simple, so it is easy to check that it is indeed correct.
Thursday, November 18, 2010
Problem Analysing and Designing Algorithm
In this article The computer programming process we described the following stages in the development of a computer program:
We now take a more detailed look at each of these stages. In this article, we describe the first three.
- Define the problem.
- Analyze the problem.
- Develop an algorithm (a method) for solving the problem.
- Write the computer program which implements the algorithm.
- Test and debug (find the errors in) the program.
- Document the program. (Explain how the program works and how to use it).
- Maintain the program.
We now take a more detailed look at each of these stages. In this article, we describe the first three.
Define the problem
Suppose we want to help a child work out the areas of squares. This defines a problem to be solved. However, a brief analysis reveals that the definition is not complete or specific enough to proceed with developing a program. Talking with the child might reveal that she needs a program which requests her to enter the length of a side of the square; the program then prints the area of the square.
Analyze the problem
We further analyze the problem to:
(a) ensure that we have the clearest possible understanding of it;
(b) determine general requirements such as the main inputs to the program and the main outputs from the program. For more complex programs, we would, for instance, also need to decide on the kinds of files which may be needed. (Think of a file as a place in the computer used for storing things like documents, pictures, programs, even songs and movies.)
If there are several ways to solve the problem, we should consider the alternatives and choose the best or most appropriate one.
In this example, the input to the program is the length of one side of the square and the output is the area of the square. We only need to know how to calculate the area. If the side is s, then the area, a, is calculated by:
a = s x s
(a) ensure that we have the clearest possible understanding of it;
(b) determine general requirements such as the main inputs to the program and the main outputs from the program. For more complex programs, we would, for instance, also need to decide on the kinds of files which may be needed. (Think of a file as a place in the computer used for storing things like documents, pictures, programs, even songs and movies.)
If there are several ways to solve the problem, we should consider the alternatives and choose the best or most appropriate one.
In this example, the input to the program is the length of one side of the square and the output is the area of the square. We only need to know how to calculate the area. If the side is s, then the area, a, is calculated by:
a = s x s
Write an algorithm to solve the problem
An algorithm is a set of instructions which, if faithfully followed, will produce a solution to a given problem or perform some specified task. When an instruction is followed, we say it is executed. We can speak of an algorithm for finding a word in a dictionary, for changing a punctured tyre or for playing a video game.
For any problem, there will normally be more than one algorithm to solve it. Each algorithm will have its own advantages and disadvantages. When we are searching for a word in the dictionary, one method would be to start at the beginning and look at each word in turn. A second method would be to start at the end and search backwards. Here, an advantage of the first method is that it would find a word faster if it were at the beginning, while the second method would be faster if the word were towards the end.
Another method for searching for the word would be one which used the fact that the words in a dictionary are in alphabetical order—this is the method we all use when looking up a word in a dictionary. In any situation, a programmer would usually have a choice of algorithms, and it is one of her more important jobs to decide which algorithm is the best, and why this is so.
In our example, we must write the instructions in our algorithm in such a way that they can be easily converted into a form which the computer can follow. Computer instructions fall into three main categories:
(1) Input instructions, used for supplying data from the ‘outside world’ to a program; this is usually done via the keyboard or a file.
(2) Processing instructions, used for manipulating data inside the computer. These instructions allow us to add, subtract, multiply and divide; they also allow us to compare two values, and act according to the result of the comparison. Also, we can move data from one location in the computer’s memory to another location.
(3) Output instructions, used for getting information out of the computer to the outside world.
Before we can write the algorithm for solving this problem, we need to explain a little bit about variables. We do this in our next article
For any problem, there will normally be more than one algorithm to solve it. Each algorithm will have its own advantages and disadvantages. When we are searching for a word in the dictionary, one method would be to start at the beginning and look at each word in turn. A second method would be to start at the end and search backwards. Here, an advantage of the first method is that it would find a word faster if it were at the beginning, while the second method would be faster if the word were towards the end.
Another method for searching for the word would be one which used the fact that the words in a dictionary are in alphabetical order—this is the method we all use when looking up a word in a dictionary. In any situation, a programmer would usually have a choice of algorithms, and it is one of her more important jobs to decide which algorithm is the best, and why this is so.
In our example, we must write the instructions in our algorithm in such a way that they can be easily converted into a form which the computer can follow. Computer instructions fall into three main categories:
(1) Input instructions, used for supplying data from the ‘outside world’ to a program; this is usually done via the keyboard or a file.
(2) Processing instructions, used for manipulating data inside the computer. These instructions allow us to add, subtract, multiply and divide; they also allow us to compare two values, and act according to the result of the comparison. Also, we can move data from one location in the computer’s memory to another location.
(3) Output instructions, used for getting information out of the computer to the outside world.
Before we can write the algorithm for solving this problem, we need to explain a little bit about variables. We do this in our next article
Sunday, November 14, 2010
Reserve Words in C
Please note that this list is somewhat misleading. Many more words are out of bounds. This is because most of the facilities which C offers are in libraries that are included in programs. Once a library has been included in a program, its functions are defined and you cannot use their names yourself.
C requires all of these reserved words to be in lower case. (This does mean that, typed in upper case, the reserved words could be used as variable names, but this is not recommended.)
(A "d" by the word implies that it is used as part of a declaration.)
auto d if
break int d
case long d
char d register d
continue return
default short d
do sizeof
double d static d
else struct
entry switch
extern d typedef d
float d union d
for unsigned d
goto while
also in modern implementations:
enum d
void d
const d
signed d
volatile d
Saturday, October 23, 2010
DataTypes in C Part-III
Data and C
How much is 2563* 455 + 5067 – 3245 /2352? You will certainly need a lot of time to solve this problem! Your computer, on the other hand, can give you the result instantaneously. However, it cannot perform this kind of calculation unless you instruct or program it to do so. Read on if you wish to learn how to write these instructions.
Writing programs to process data
In previous articles, you learnt different ways of representing and storing data in a computer’s memory. You also learnt that a computer performs various operations to processes data and produce meaningful information. C offers a rich operator collection for performing various data processing operations. For example, you can perform arithmetic calculations, compare values, and modify variables. In this article, you will learn about arithmetic and other operators used in C programming.
Arithmetic operators
In C, arithmetic operations (addition, subtraction, multiplication, division, and modulo division) are performed using five arithmetic operators:.
1. + - Addition
2. - - Subtraction
3. * - Multiplication
4. / - Division
5. % - Modulo Division (remainder after integer division)
The following program uses all the five operators listed above.
|
When you run this program, you will see this:
Addition
Result=7.000000
Subtraction
Result=3.000000
Multiplication
Result=10.000000
Division
Result=2.000000
Observe the last output. The result of division is displayed as 2.000000 instead of 2.500000! What is the reason for this? Let us find out.
Division works differently for ints and floats. Floating-point division results in a float, and integer division results in an int. In this example, the two variables involved in the division calculation are of integer type, and hence the result is an integer. In C, any fraction resulting from an integer division is ignored. This process is called truncation. This can be avoided using a mechanism called typecasting.
Typecasting
Typecasting allows you to convert the value of an expression to a particular data type. If you want the result of 5/2 in the above example as 2.5, you must type the code in line 12 as follows:
c=(float) a/b;
A pair of parentheses with a data type written inside is known as C’s cast operator. To print the output correctly, remember to change the format string in the printf() statement on line 13 from %d to %f.
Expressions and operator precedence
What is an expression?
If you have done some basic math, you would have heard of expressions. An expression consists of a combination of operators and operands (values on which an operator operates on). For example
c=a+b;
or
x=a*(b/c+d*3)+5;
As you can see from the above expressions, operands can be constants, variables, or combinations of the two.
In C, arithmetic expressions are evaluated according to a strict hierarchy of operators. Given below is the hierarchy of arithmetic operators in C:
Priority | Operators | Description |
1st | * / % | multiplication, division, modulo division |
2nd | + - | addition, subtraction |
3rd | = | Assignment |
If there are two operators of the same level in an expression, the operator that comes first is considered first — ‘first come, first served’.
|
When you run this program you will see this:
Result=-27
Let us see how you got this result.
The expression result= a+b%5-c*d/2 is evaluated as follows:
result=10+20%5-15*5/2 1. result=10+0-15*5/2 % is evaluated first. The remainder is 0 when 5 divides 20. 2. result=10+0-75/2 Multiplication is performed. 15*5=75. 3. result=10+0-37 Division is performed. (75/2 results in 37 instead of 37.5 because both 75 and 2 are integers. 4. result=10-37 Addition is performed because it comes before minus. 5. result=-27 Finally subtraction is performed and –27 is stored in the variable result. |
Try these out:
- Write a program to accept the marks of a student in three subjects, and display the total marks and the average.
- Write a program to accept basic salary, HRA, DA and PF and display the net salary. (Hint: Net salary is computed as: Basic+HRA+DA–PF).
- Write a program to accept the radius of a circle and display its radius and perimeter. (Hint: area=Õ*r*r; perimeter= 2*Õ*r)
Friday, October 22, 2010
Data Types in C Part-II
Data and C
Suppose you develop a piece of software to be used for computerizing a bank’s operations. In the code for this software, you would write a program to store details of the bank’s customers. In this program let us assume that you have used the assignment operator (refer to the previous article) for storing customer details such as name, age and telephone number in the respective variables. How would you enter the details of a new customer?
You would do this by opening the program, assigning the values to variables, and compiling the program again. However, this is a cumbersome process, as you have to recompile the program each time that you make a change. Moreover, when using an assignment operator, you may not know in advance the values that you want to assign to the variables.
Data and input functions
For the reasons mentioned above, almost every program should include statements used to request input from users while the program is running. Such statements are called input statements. The C compiler has built-in input functions for storing data (entered through a keyboard) in variables while the program is running. These input functions facilitate interactive programming, i.e., you can interact with a running program. One such widely used function in C is scanf().
The scanf() function
The syntax of scanf() and that of printf() look alike except that an ‘&’ symbol precedes every variable in the case of scanf(). This function is used to input different kinds of values — int, float, and char.
Read the following code. It demonstrates the use of the scanf() function:
/* Author: Globarena Purpose: demonstration of scanf() function */ main() { 1. int a; 2. float b; 3. char c; 4. printf(“Enter an integer:”); 5. scanf(“%d”,&a); 6. printf(“Enter a float:”); 7. scanf(“%f”,&b); 8. printf(“Enter a character:”); 9. scanf(“%c”,&c); 10. printf(“You entered %d %f %c”, a, b, c); } |
When you run this program, it prompts you to enter first an integer, then a float, and finally a character. After you enter these values, the last printf() function displays all the three values entered.
Other input functions
Apart from the scanf() function, there are also other functions such as getchar() and gets() to store characters and strings (set of characters). The following program demonstrates the use of these functions.
/* Author: Globarena Purpose: This program accepts a character from the keyboard and displays it on the screen. */ #include<stdio.h> main () { 1. char a; 2. printf (“Enter any character:”); 3. a=getchar(); 4. printf(“The character you entered is:%c”,a); } |
Observe how the function getchar() is used in this program. This function receives a character entered by the user and stores it in the variable a. The printf() function written below the getchar() statement displays on the screen the character that you entered from the keyboard. C, however, also provides a function called putchar() to display the character on the screen. You can use this function in the above program instead of printf(). The following statement is written to use putchar() in the above program.
|
Accepting strings using gets() function
In the previous articles, you saw a program that displayed a string (Hello, World) on the screen using the printf() function. Now you will see how to accept a string from keyboard and display it.
Observe the following program.
|
In this program:
- The first statement — char a[25]; — informs the compiler to set aside 25 locations to store 25 characters.
- The second statement prompts the user by displaying the message “Enter a string” on the screen.
- The third statement accepts the string from the keyboard.
- The fourth statement displays the string that you entered on the screen.
- %s stands for ‘format string’ to print strings.
You can also get the same result for the above program by using another kind of output function, puts(). This function is used exclusively for handling strings. It can’t be used for printing numeric data. The following statement would be written to use puts() in the above program.
|
Try it out:
1. Write a program to accept and store the values 15, 30.5 and ‘A’ in the variables i, f, and c using the function scanf(), and to display them using the printf() function.
2. Write a program to accept and store a character (say, ‘$’) in the variable ch using the function getchar() and t display it on the screen using the function putchar().
3. Write a program to accept and store a string (say, “Hi-Tech City”) in the variable city and to display it on the screen using the function puts().
Thursday, October 21, 2010
Data Types in C Part-I
Data and C
Programming is all about processing data to get the desired results. Programs accept data and perform some kind of task. The task could be as simple as calculating percentage of marks or as complex as DNA fingerprint analysis.
In this article, you will learn how C programs work with data and perform tasks.
Data is generally defined as the raw facts input into the computer. However, in reference to C, data has a more specific meaning. It refers to two kinds of values — those associated with constants and those represented by variables.
Variables and constants
Constants refer to data that remains unchanged throughout the program execution. For example, in a program to find the area of a circle, the value of ∏ (3.1412) is constant. Some more examples of constants include numbers such as 10, 100, 22.34 and characters such as ’A’,’ ’Z’, ’*’ and ’$’.
Variables, on the other hand, store data that may vary during program execution. In the example of finding the area of a circle, the area will change from circle to circle.
In programming, each variable actually refers to a memory location where a constant is stored. Every variable has a name. You should note the following rules before naming a variable:
- Only alphabets, numerals, and underscores (_) are permitted (spaces and special symbols are not allowed).
- The name cannot start with a digit.
- Upper case and lower case letters are treated as different.
- A variable cannot be a C language keyword.
Note: Always choose meaningful names for variables.
Examples of variable names: marks1, student_no, sum, product, etc.
Data types
The C compiler must be informed about the type of data (numbers, alphabets, or special characters) you intend to store in a variable. For this, you can use C’s built-in data types.
There are three primary data types in C — int, float, and char. Other data types such as long and double are derived from these.
The int data type
The int data type can be used to store both positive and negative integers, and thus stands for ‘signed integer’. This data type also offers variations such as long and short to accommodate larger and smaller values. See Table 1 for information on the amount of memory this data type occupies and the range of values you can store).
The float data type
The float data type is used to store fractional numbers (real numbers). So, if you wish to write a program to compute something, you should use the float data type. A float value consists of an exponential and a fractional portion. Consider these values:
2.3456e-1 =2.3456 x 10-1 = 0.23456
2.3456e+2 =2.3456 x 10+2 = 234.56
Here, the values to the left of the character ‘e’ denote the fraction while those to the right denote the exponent. The complier uses the ‘e’ to separate and identify these two components. The exponent must have a positive or negative value (positive by default). To accommodate larger fractions, C provides another data type called double. See Table 1 for the memory this data type occupies and the range of values you can store using float and double).
The char data type
The char data type is used for storing characters such as alphabets and special symbols (e.g. ‘*’, ‘$’, and ‘#’). Computers use a numerical code called ASCII (American Standard Code for Information Interchange) to represent these characters. There are 256 characters in the ASCII set, all of which can be stored using the char data type.
Note: All the data types discussed above can be prefixed with the keywords signed or unsigned. The keyword signed represents both positive and negative values, whereas unsigned refers only to positive values.
Table 1
Data type | Memory size (in bytes) | Range |
int | 2 or 4 (depends on whether you are using 16-bit processor or 32-bit processor) | -32,768 to +32767 (2-bytes) -2,147,483,648 to +2,147,483,648 (4-bytes) |
short | 2 | -32768 to +32767 |
long | 4 | -2,147,483,648 to +2,147,483,648 |
float | 4 | ±10 e-37 to ±10e+37 |
double | 8 | ±10 e-307 to ±10e+307 |
char | 1 | -128 to +127 |
Declaring variables in a C program
As mentioned earlier, you have to inform the compiler about each variables name and the kind of data it is meant to store. This is called variable declaration. For example, you can create a variable called ‘num’ to store an integer value in memory by writing the statement:
int num;
Here, int is the data type and num is the name of the variable.
Note: Before it is used in a program, a variable must be declared. Also, remember that variables should always be declared at the beginning of a function.
Storing data in variables
The easiest way to store a value in a variable named ‘num’ is by writing the statement num=value.
Here, ‘=’ is called an assignment operator because it assigns a value to the variable. Writing
num=10;
indicates to the complier that the value ‘10’ should be stored in the ‘num’ variable.
Note: You can use the assignment operator to store a value in a variable you are declaring. For example:
int number=10;
Writing a program to print values in variables
Now that you know how to store values in variables, let us write a program to print stored values on the screen. Consider this program:
/* Author: Globarena Date: 15/10/2003 Purpose: To print values stored in variables */ #include<stdio.h> main() { int a=10; float b=3.1412; char ch=’A’; printf(“%d\n%f\n%c”,a,b,ch); } |
When you run this program, the following output will be displayed on screen:
10
3.1412
A
Observe how the printf() function is used in the program. Doesn’t it look different from the printf() used to print messages ? (See article 2.) You might also be wondering what those strange characters (%d, %f, \n, etc.) are.
The characters %d, %f, and %c are called format specifiers or simply format strings. The ‘%’ symbol alerts the compiler that a variable is to be printed at that location and the letter that follows tells it to print the value as an int, float, char, and so on.
The character ‘\n’ is called a newline character. It is used to insert a new line so that the values in variables mentioned after it are printed on a new line (as shown above). If this character is not used, the output will look as shown below:
103.1412A
This would be difficult to comprehend.
Note: Characters like the ‘\n’ character that start with ‘\’ are called escape sequences.
The following tables gives you a partial list of format strings and escape sequences that you will frequently come across in C programs.
Table 2 Table 3
Sl. No | Data type | Format Specifier |
1. | int | d |
2. | float | f |
3. | char | c |
4. | unsigned int | u |
5. | string | s |
6. | long int | ld |
7. | double | lf |
Sl. No | Escape sequence | Purpose |
1. | \n | Newline |
2. | \t | Tab |
3. | \a | Beep |
4. | \b | Backspace |
5. | \r | Return |
Try it out:
- Write a program to store 10, 12.5, and a character ‘Z’ in integer, float, and character variables respectively and display the values on the screen.
- Write a program to store 15, 3,14, and ’X’ in integer, float, and character variables respectively and display the values on separate lines on the screen.
Subscribe to:
Posts (Atom)