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
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....
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. •...
Write an ARM assembly language program that counts the number of 1’s for any value in...
Write an ARM assembly language program that counts the number of 1’s for any value in R0. The program must assemble/compile in KEIL and must be able to run in the KEIL simulator. Generally, R0 may contain any value, but for purpose of this exercise, you may move 0x2345ABCD into R0. The number in R0 does not need be preserved. You may use any other registers as you need. The result, total count of 1’s in R0, should be in...
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,...
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?...
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...
Question 1 Which statement is false about what Data Types defines Question 1 options: What values...
Question 1 Which statement is false about what Data Types defines Question 1 options: What values a variable cannot hold? How much memory will be reserved for the variable? What value a variable will hold? How the program will use the data type? Question 2 Using the structure below, which of the following statements about creating an array (size 20) of structures are not true? struct Employee{     string emp_id;     string emp_name;     string emp_sex; }; Question 2 options:...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in Lab 2 to obtain a diameter value from the user and compute the volume of a sphere (we assumed that to be the shape of a balloon) in a new program, and implement the following restriction on the user’s input: the user should enter a value for the diameter which is at least 8 inches but not larger than 60 inches. Using an if-else...
Implement a scientific calculator using MVC constructs in Swift 3 Programming language(basic calculator IOS app) Requirements:...
Implement a scientific calculator using MVC constructs in Swift 3 Programming language(basic calculator IOS app) Requirements: It needs to be able to handle multiple operations in a sequence. It should ONLY use the last operand if multiple operands are entered consecutively Example: “5++-1=”is equivalent to “5-1=” Proper error handling and self-correction. “+-5” is equivalent to “negative 5” “0004+32 ++ 0101 -- 04=” is equivalent to “4+32+101-4=” Implement 3 more buttons: ¼ ½ and ¾ at the bottom of the keyboard....
For question #1 to #5 choose one of the following types of variable A) qualitative variable...
For question #1 to #5 choose one of the following types of variable A) qualitative variable B) discrete variable C) continuous variable 1. What is your favorite color? 2. How many books did you read in the past 3 months? 3. Name one thing that you like about College of Alameda 4. How many miles do drive to get to a supermarket from your house? 5. How many siblings do you have?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT