Skip to main content

ads1

Class 10th Chapter 11 :- Data Types, Operators and Expression in C Language




 

Chapter :- 11 Data Types, Operators and Expression in C Language


What is Data Type ?
The type of value that can be assigned to an identifier is known as its data type.

C language uses set of keywords to relate a data with its value. These keywords identify two things, the type of value that can be stored in an identifier and the memory space required by an identifier.

Each data type is allocated a fixed memory space in C. It is denoted by bytes. 1 byte is combination of 8 bits.

Basic Data Types of C
C language supports basic data types called integer, decimal and character.

Operators

An operator is a symbol that identifies the operation that can be performed on operands. The operators in C can be categorized into eight types as mentioned :

1. Arithmetic Operators.
2. Assignment Operators.
3. Relational Operators.
4. Increment and Decrement Operators.
5. Conditional Operators.
6. Logical Operators.
7. Bitwise Operators.
8. Special Operators.

Choose the correct option from the following:

(1) Which of the following keywords refer to integer data type ?

(a) integer
(b) Integer
(c) INTEGER
(d) int

(2) Which of the following refers to an empty value ?

(a) void
(b) Void
(c) char
(d) float

(3) Which of the following refers to size of memory allocated to float as per gcc compiler ?

(a) 1
(b) 2
(c) 4
(d) 6

(4) Which of the following is a valid keyword in C that identifies valid character value ?

(a) char
(b) character
(c) CHAR
(d) CHARACTER

(5) Which of the following is a user defined data type in C ?

(a) int
(b) enum
(c) char
(d) float

(6) Which of the following is used to provide an alias to existing data types in C ?
(a) enum
(b) def
(c) pointer
(d) typedef

(7) The symbol & belong to which of the following operator types in C?

(a) Relational
(b) Arithmetic
(c) Logical
(d) Bitwise

(8) The symbol ! belong to which of the following operator types in C?

(a) Relational
(b) Arithmetic
(c) Logical
(d) Bitwise

(9) The = symbol is used for which of the following operations in C?

(a) Equality Check
(b) Assignment
(c) Comment
(d) Formula

(10) Which of the following refer to the meaning of value++ in C ?

(a) Post Increment
(b) Post Decrement
(c) Pre Increment
(d) Pre Decrement
 

ads2

Popular posts from this blog

11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following:

    11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following: Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic Salary <= 20000 : HRA = 25%, DA = 90% Basic Salary > 20000 : HRA = 30%, DA = 95% Static Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     if(basic <=10000)     {         da = basic * 0.8;         hra = basic *0.2;     }              else if(basic <=20000)     {         da = basic * 0.9;         hra = basic *0.25;     }     else     {         da = basic * 0.95;         hra = basic * 0.3;     }     gross = basic + da + hra;     System.out.println("The Gross Salary is :-"+gross);     } } Output :-  Dynamic Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     Scanner in = new Scanner(System.in);     System.out.println("Enter the Basic Salary

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise or class wise.

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise  or class wise. Solution :-   # x-axis is shows the subject and y -axis # shows the markers in each subject # import pandas and matplotlib  import pandas as pd  import matplotlib.pyplot as plt # Simple Line Chart with setting of Label of X and Y axis, # title for chart line and color of line  subject = ['Physic','Chemistry','Mathematics', 'Biology','Computer'] marks =[80,75,70,78,82] # To draw line in red colour plt.plot(subject,marks,'r',marker ='*')     # To Write Title of the Line Chart plt.title('Marks Scored') # To Put Label At Y Axis plt.xlabel('SUBJECT')           # To Put Label At X Axis plt.ylabel('MARKS')             plt.show() Output :- 

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category.

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category. import pandas as pd  # initialize list of lists data = [['CAR','Maruti',1000000],['AC','Hitachi',55000],['AIRCOLLER','Bajaj',12000], ['WASHING MACHINE','LG',15000],['CAR','Ford',7000000],['AC','SAMSUNG',45000],['AIRCOLLER','Symphony',20000],['WASHING MACHINE','Wirlpool',25000]] Col=['itemcat','itemname','expenditure'] # Create the pandas DataFrame qrtsales = pd.DataFrame(data,columns=Col) # print dataframe.  print (qrtsales) qs=qrtsales.groupby('itemcat')  print('Result after Filtering Dataframe')  print(qs['itemcat','expenditure'].sum()) Output :-