SlideShare a Scribd company logo
Team Emertxe
Function and Pointer
Basics
Assignment 5
Assignment 5
Assignment 5
WAP to print ‘n’ bits from LSB of a number
WAP to print ‘n’ bits from LSB of a number
Input:
Assignment 5
WAP to print ‘n’ bits from LSB of a number
Input: Read integer ‘num’ and number of bits ‘n’
Assignment 5
WAP to print ‘n’ bits from LSB of a number
Input: Read integer ‘num’ and number of bits ‘n’
Output:
Assignment 5
WAP to print ‘n’ bits from LSB of a number
Input: Read integer ‘num’ and number of bits ‘n’
Output: Print ‘n’ number of bits from LSB end of ‘num’.
Assignment 5
Example’s:
Assignment 5
Example’s:
➢ Input: num = 10 and n = 12
Assignment 5
Example’s:
➢ Input: num = 10 and n = 12
Output: Print last 12 bits in binary format of num 10:
Assignment 5
Example’s:
➢ Input: num = 10 and n = 12
Output: Print last 12 bits in binary format of num 10:
Assignment 5
0 0 0
1
0
1
0
0
0 0 0
0
num
Example’s:
➢ Input: num = 15 and n = 4
Assignment 5
Example’s:
➢ Input: num = 15 and n = 4
Output: Print last 4 bits in binary format of num 15:
Assignment 5
Example’s:
➢ Input: num = 15 and n = 4
Output: Print last 4 bits in binary format of num 15:
Assignment 5
1
1
1
1
num
Example’s:
➢ Input: num = 6 and n = 3
Assignment 5
Example’s:
➢ Input: num = 6 and n = 3
Output: Print last 3 bits in binary format of num 6:
Assignment 5
Example’s:
➢ Input: num = 6 and n = 3
Output: Print last 3 bits in binary format of num 6:
Assignment 5
?
?
?
num
Example’s:
➢ Input: num = 6 and n = 3
Output: Print last 3 bits in binary format of num 6:
Assignment 5
0
1
1
num
Example’s:
➢ Input: num = 25 and n = 5
Assignment 5
Example’s:
➢ Input: num = 25 and n = 5
Output: Print last 5 bits in binary format of num 25:
Assignment 5
Example’s:
➢ Input: num = 25 and n = 5
Output: Print last 5 bits in binary format of num 25:
Assignment 5
?
?
?
num ?
?
Example’s:
➢ Input: num = 25 and n = 5
Output: Print last 5 bits in binary format of num 25:
Assignment 5
0
1
1
num 0 1
Sample execution:-
Assignment 5
Sample execution:-
Assignment 5
Pre-requisites:-
Assignment 5
Pre-requisites:-
➢ Bitwise operators
Assignment 5
Pre-requisites:-
➢ Bitwise operators
➢ Functions
Assignment 5
Pre-requisites:-
➢ Bitwise operators
➢ Functions
Objective:-
Assignment 5
Pre-requisites:-
➢ Bitwise operators
➢ Functions
Objective:-
➢ To understand the concept of Bitwise operations.
Assignment 5
Team Emertxe
Thank you

More Related Content

Similar to 05_print_bits.pdf

16_factorial.pdf
16_factorial.pdf16_factorial.pdf
07_triangle_pattern.pdf
07_triangle_pattern.pdf07_triangle_pattern.pdf
02_replace_n_bits.pdf
02_replace_n_bits.pdf02_replace_n_bits.pdf
02_replace_n_bits.pdf
02_replace_n_bits.pdf02_replace_n_bits.pdf
01_odd_even.pdf
01_odd_even.pdf01_odd_even.pdf
01 odd even
01 odd even01 odd even
18_negative_fibonacci.pdf
18_negative_fibonacci.pdf18_negative_fibonacci.pdf
18_negative_fibonacci.pdf
Emertxe Information Technologies Pvt Ltd
 
algorithm
algorithmalgorithm
algorithm
Divya Ravindran
 
08_circular_right_shift.pdf
08_circular_right_shift.pdf08_circular_right_shift.pdf
08_circular_right_shift.pdf
Emertxe Information Technologies Pvt Ltd
 
08_pyramid_pattern.pdf
08_pyramid_pattern.pdf08_pyramid_pattern.pdf
Insider mathematical
Insider   mathematicalInsider   mathematical
Insider mathematical
Aditi Saxena
 
4. algorithm
4. algorithm4. algorithm
4. algorithm
SHIKHA GAUTAM
 

Similar to 05_print_bits.pdf (12)

16_factorial.pdf
16_factorial.pdf16_factorial.pdf
16_factorial.pdf
 
07_triangle_pattern.pdf
07_triangle_pattern.pdf07_triangle_pattern.pdf
07_triangle_pattern.pdf
 
02_replace_n_bits.pdf
02_replace_n_bits.pdf02_replace_n_bits.pdf
02_replace_n_bits.pdf
 
02_replace_n_bits.pdf
02_replace_n_bits.pdf02_replace_n_bits.pdf
02_replace_n_bits.pdf
 
01_odd_even.pdf
01_odd_even.pdf01_odd_even.pdf
01_odd_even.pdf
 
01 odd even
01 odd even01 odd even
01 odd even
 
18_negative_fibonacci.pdf
18_negative_fibonacci.pdf18_negative_fibonacci.pdf
18_negative_fibonacci.pdf
 
algorithm
algorithmalgorithm
algorithm
 
08_circular_right_shift.pdf
08_circular_right_shift.pdf08_circular_right_shift.pdf
08_circular_right_shift.pdf
 
08_pyramid_pattern.pdf
08_pyramid_pattern.pdf08_pyramid_pattern.pdf
08_pyramid_pattern.pdf
 
Insider mathematical
Insider   mathematicalInsider   mathematical
Insider mathematical
 
4. algorithm
4. algorithm4. algorithm
4. algorithm
 

More from Emertxe Information Technologies Pvt Ltd

Career Transition (1).pdf
Career Transition (1).pdfCareer Transition (1).pdf
Career Transition (1).pdf
Emertxe Information Technologies Pvt Ltd
 
10_isxdigit.pdf
10_isxdigit.pdf10_isxdigit.pdf
01_student_record.pdf
01_student_record.pdf01_student_record.pdf
02_swap.pdf
02_swap.pdf02_swap.pdf
01_sizeof.pdf
01_sizeof.pdf01_sizeof.pdf
07_product_matrix.pdf
07_product_matrix.pdf07_product_matrix.pdf
06_sort_names.pdf
06_sort_names.pdf06_sort_names.pdf
05_fragments.pdf
05_fragments.pdf05_fragments.pdf
04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
02_variance.pdf
02_variance.pdf02_variance.pdf
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf

More from Emertxe Information Technologies Pvt Ltd (20)

premium post (1).pdf
premium post (1).pdfpremium post (1).pdf
premium post (1).pdf
 
Career Transition (1).pdf
Career Transition (1).pdfCareer Transition (1).pdf
Career Transition (1).pdf
 
10_isxdigit.pdf
10_isxdigit.pdf10_isxdigit.pdf
10_isxdigit.pdf
 
01_student_record.pdf
01_student_record.pdf01_student_record.pdf
01_student_record.pdf
 
02_swap.pdf
02_swap.pdf02_swap.pdf
02_swap.pdf
 
01_sizeof.pdf
01_sizeof.pdf01_sizeof.pdf
01_sizeof.pdf
 
07_product_matrix.pdf
07_product_matrix.pdf07_product_matrix.pdf
07_product_matrix.pdf
 
06_sort_names.pdf
06_sort_names.pdf06_sort_names.pdf
06_sort_names.pdf
 
05_fragments.pdf
05_fragments.pdf05_fragments.pdf
05_fragments.pdf
 
04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
04_magic_square.pdf
 
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
03_endianess.pdf
 
02_variance.pdf
02_variance.pdf02_variance.pdf
02_variance.pdf
 
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
01_memory_manager.pdf
 
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
09_nrps.pdf
 
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
11_pangram.pdf
 
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
10_combinations.pdf
 
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
08_squeeze.pdf
 
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
07_strtok.pdf
 
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
06_reverserec.pdf
 
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf
05_reverseiter.pdf
 

Recently uploaded

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 

Recently uploaded (20)

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 

05_print_bits.pdf