Question

Answer the following question 1. What basic requirements of a C program are there ? 2....

Answer the following question
1. What basic requirements of a C program are there ?
2. What basic requirements of Identifiers (variable name) are there?
3. Explains what data types are and how they are used to classify the value of a variable in a programming language.
4. What is Variable? What should be done before you use a variable?

Homework Answers

Answer #1

1)


C is a general purpose programming language developed by Dennies Ritchie for Bell labs. As any other programing language'C' program also have some basic requiremnet to function properly

  • We must have installed a c compiler into your machine becouse C is a high level language inorder to execute it by the processor we need a compiler which convert it to machine codes
  • A c program typically contains a pre-processor directive statement at the beginning.Such statement are begin with a '#' symbol ,they are called header files.All basic functions such as input and outputs operations are defined in some header files hence header file are a basic requirement of a c program
  • C programs is a collection of functions.It contain a main() function and may or maynot with user defined functions.C compiler starts execution from main() functions hence every C program must contain the main() function

2)

  • An identifier can contain only letters (smmal and capitals), numbers and underscore
  • Use of keywordds as identifiers are prohibited
  • The first letter of identifier must be letter or underscore
  • Identifiers should be unique

(In some OS ,ANSI C recoganize only the first 32 characters on the variable name hence varaible name should be less than it in length)


3)


Data types is actually the classification of variables according to the data it can store or the operations which can done on it.Data types are categorised as built-in and user defined


Built in data types in C are

  • char :A basic data type which can store a single character(need one byte of memory)
  • int : used to store integer type data (need two byte of memory)
  • float :used to store decimal numbers (single precision)
  • double it ios used to store numbers with double precision

So in C programming we have to use the apropriate variable to store different type of datas


4)


Identifiers are the names of variables ,functions ,classes etc.., defined by programmer.Identifiers are one of the primary requrements of every programming language.Every programming lanuage have their own rules in creation of identifirs
(as the rules of C)


In C program We have to declare every variable with apropriate data types .Data types are choosed according to the type of data is used to store in that variable

for example: int num;
char ch;

  

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Each of the following Programming Challenges can be solved by a program that performs three basic...
Each of the following Programming Challenges can be solved by a program that performs three basic tasks—Input Data, Process Data, and Output Results. For each problem, use pseudocode to design a suitable program to solve it. Be sure to identify the data type of each variable used. The manager of the Super Supermarket would like to be able to compute the unit price for products sold there. To do this, the program should input the name and price of an...
In C programming, Thank you Write a program to compute the area of a circle. You...
In C programming, Thank you Write a program to compute the area of a circle. You have to write a complete “C” program that compiles and runs in Codeblocks. Program requirements: 1. Declare the variables needed: radius (r) and area (yourLastName). 2. Calculate and print the area of each circle. 3. The program MUST prompt the user for a new radius (r) over and over until the user types -1. 5. Use the type double for all decimal numbers. 6....
Design a class with the following requirements: 1- give the class a name from your choice....
Design a class with the following requirements: 1- give the class a name from your choice. 2- write some code that creates three instance variables, choose a name and type for each one of them. (must have two private and one public variables) 3- Initialize the variables using two different constructors. 4- Use mutator and accessor methods (set and get) for the private data members. 5- Display the value of each member variable using a method. 6- In the main,...
Design a class with the following requirements: 1- give the class a name from your choice....
Design a class with the following requirements: 1- give the class a name from your choice. 2- write some code that creates three instance variables, choose a name and type for each one of them. (must have two private and one public variables) 3- Initialize the variables using two different constructors. 4- Use mutator and accessor methods (set and get) for the private data members. 5- Display the value of each member variable using a method. 6- In the main,...
C program question: Write a small C program connect.c that: 1. Initializes an array id of...
C program question: Write a small C program connect.c that: 1. Initializes an array id of N elements with the value of the index of the array. 2. Reads from the keyboard or the command line a set of two integer numbers (p and q) until it encounters EOF or CTL - D 3. Given the two numbers, your program should connect them by going through the array and changing all the entries with the same name as p to...
Programming in C: 1. Given the following variable declarations: const size_t n = 50; 2. Write...
Programming in C: 1. Given the following variable declarations: const size_t n = 50; 2. Write the declaration of an an array of pointers to n memory blocks containing 16-bit signed integer values. Use 'x' for the name of the variable. 3. What is the type of the variable x? uint8_t *x[256]; 4. What type does the variable x decay to when used in an expression? uint8_t *x[256] 5. What is the data type of an array of five strings?...
Item 1 – View my balance, 2 – Withdraw cash, and 3 – Deposit funds are...
Item 1 – View my balance, 2 – Withdraw cash, and 3 – Deposit funds are modules of the ATM program. You are requested to extend the program by writing the pseudocode that includes the three modules above. Please include all the parameters expected in each module. Please note that some methods might be required to return data while others not. Your solution should satisfy the following requirements: • The solution must illustrate the use of good programming practices. •...
Answer the following questions with this scenario: A school district runs a gifted language program in...
Answer the following questions with this scenario: A school district runs a gifted language program in fifth grade with a selection criterion of 97th percentile. That is, students who score at 97th percentile or above on a standardized language test are eligible for the gifted program. Question A: What is the probablility of randomly drawing a student from the whole population of fifth-graders that would meet the selection criterion for the gifted program? Explain how you determined the answer. Question...
AWK utility Consider the following awk program: { $1="A" ; print $0 } What is the...
AWK utility Consider the following awk program: { $1="A" ; print $0 } What is the output if the input consists of the following line: program program Question 1 options: program program program A program The awk program fails None of the above Question 2 The awk command can use an inline script specified on the command line or a file based script specified by the -f option Question 2 options:    True    False Question 3 Match each awk...
Write a C++ program. 1) Write a program that writes the grades for 3 students. Declare...
Write a C++ program. 1) Write a program that writes the grades for 3 students. Declare a variable of type ofstream which is used to output a stream into a file: ofstream output; // output is the name of the variable Prompt the user to input values for the grades of 3 students. Use the output operator (<<) to write the grades into grades.txt: output << grade1 << " " << grade2 << " " << grade3 << endl; You...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT