SlideShare a Scribd company logo
1 of 2
Download to read offline
1 www.cppforschool.com 
STRINGS 
[SET – 1] 
Question 1 Write a program to find the length of string. 
Question 2 Write a program to display string from backward. 
Question 3 Write a program to count number of words in string. 
Question 4 Write a program to concatenate one string contents to another. 
Question 5 Write a program to compare two strings they are exact equal or not. 
Question 6 Write a program to check a string is palindrome or not. 
Question 7 Write a program to find a substring within a string. If found display its starting 
position. 
Question 8 Write a program to reverse a string. 
Question 9 Write a program to convert a string in lowercase. 
Question 10 Write a program to convert a string in uppercase. 
Question 11 Write the output of the following program 
#include <iostream.h> 
#include <ctype.h> 
void Encrypt(char T[]) 
{ 
for (int i=0;T[i]!='0';i+=2) 
if (T[i]=='A' || T[i]=='E') 
T[i]='#'; 
else if (islower(T[i])) 
T[i]=toupper(T[i]); 
else 
T[i]='@'; 
} 
void main() 
{ 
char Text[]="SaVE EArtH"; 
Encrypt(Text); 
cout<<Text<<endl; 
} 
Question 12 Give the output of the following program segment 
char *NAME = "CoMPutER"; 
for (int x = 0: x < strlen(NAME); x++) 
if (islower(NAME [x])) 
NAME [x] = toupper(NAME[x]); 
else
if (isupper(NAME[x]) 
2 www.cppforschool.com 
if (x%2 ==0) 
NAME[x] = tolower(NAME[x]); 
else 
NAME[x] =NAME[x-1]; 
puts(NAME);

More Related Content

Similar to A10

Looping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptxLooping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptx
adihartanto7
 
Steganography, as defined by Webster’s Dictionary, is the art or p.docx
Steganography, as defined by Webster’s Dictionary, is the art or p.docxSteganography, as defined by Webster’s Dictionary, is the art or p.docx
Steganography, as defined by Webster’s Dictionary, is the art or p.docx
susanschei
 
Hey i have attached the required file for my assignment.and addi
Hey i have attached the required file for my assignment.and addiHey i have attached the required file for my assignment.and addi
Hey i have attached the required file for my assignment.and addi
sorayan5ywschuit
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
mary772
 

Similar to A10 (20)

Python assignment 4
Python assignment 4Python assignment 4
Python assignment 4
 
Looping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptxLooping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptx
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptx
 
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docxShad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
 
Master Python in 15 Days.pdf
Master Python in 15 Days.pdfMaster Python in 15 Days.pdf
Master Python in 15 Days.pdf
 
Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)
 
The Error of Our Ways
The Error of Our WaysThe Error of Our Ways
The Error of Our Ways
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL
 
practice problems on functions IN SWIFT
practice problems on functions IN SWIFTpractice problems on functions IN SWIFT
practice problems on functions IN SWIFT
 
Steganography, as defined by Webster’s Dictionary, is the art or p.docx
Steganography, as defined by Webster’s Dictionary, is the art or p.docxSteganography, as defined by Webster’s Dictionary, is the art or p.docx
Steganography, as defined by Webster’s Dictionary, is the art or p.docx
 
Hey i have attached the required file for my assignment.and addi
Hey i have attached the required file for my assignment.and addiHey i have attached the required file for my assignment.and addi
Hey i have attached the required file for my assignment.and addi
 
practice problems on array IN SWIFT
practice problems on array IN SWIFTpractice problems on array IN SWIFT
practice problems on array IN SWIFT
 
practice problems on array IN SWIFT
practice problems on array  IN SWIFTpractice problems on array  IN SWIFT
practice problems on array IN SWIFT
 
practice problems on array IN SWIFT
practice problems on array IN SWIFTpractice problems on array IN SWIFT
practice problems on array IN SWIFT
 
Programming Practice Questions_C
Programming Practice Questions_CProgramming Practice Questions_C
Programming Practice Questions_C
 
Programming with Python
Programming with PythonProgramming with Python
Programming with Python
 
Cosc 1436 java programming/tutorialoutlet
Cosc 1436 java programming/tutorialoutletCosc 1436 java programming/tutorialoutlet
Cosc 1436 java programming/tutorialoutlet
 
Processing Regex Python
Processing Regex PythonProcessing Regex Python
Processing Regex Python
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
 

More from lksoo (20)

Lo48
Lo48Lo48
Lo48
 
Lo43
Lo43Lo43
Lo43
 
Lo39
Lo39Lo39
Lo39
 
Lo37
Lo37Lo37
Lo37
 
Lo27
Lo27Lo27
Lo27
 
Lo17
Lo17Lo17
Lo17
 
Lo12
Lo12Lo12
Lo12
 
T3
T3T3
T3
 
T2
T2T2
T2
 
T1
T1T1
T1
 
T4
T4T4
T4
 
P5
P5P5
P5
 
P4
P4P4
P4
 
P3
P3P3
P3
 
P1
P1P1
P1
 
P2
P2P2
P2
 
L10
L10L10
L10
 
L9
L9L9
L9
 
L8
L8L8
L8
 
L7
L7L7
L7
 

Recently uploaded

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

A10

  • 1. 1 www.cppforschool.com STRINGS [SET – 1] Question 1 Write a program to find the length of string. Question 2 Write a program to display string from backward. Question 3 Write a program to count number of words in string. Question 4 Write a program to concatenate one string contents to another. Question 5 Write a program to compare two strings they are exact equal or not. Question 6 Write a program to check a string is palindrome or not. Question 7 Write a program to find a substring within a string. If found display its starting position. Question 8 Write a program to reverse a string. Question 9 Write a program to convert a string in lowercase. Question 10 Write a program to convert a string in uppercase. Question 11 Write the output of the following program #include <iostream.h> #include <ctype.h> void Encrypt(char T[]) { for (int i=0;T[i]!='0';i+=2) if (T[i]=='A' || T[i]=='E') T[i]='#'; else if (islower(T[i])) T[i]=toupper(T[i]); else T[i]='@'; } void main() { char Text[]="SaVE EArtH"; Encrypt(Text); cout<<Text<<endl; } Question 12 Give the output of the following program segment char *NAME = "CoMPutER"; for (int x = 0: x < strlen(NAME); x++) if (islower(NAME [x])) NAME [x] = toupper(NAME[x]); else
  • 2. if (isupper(NAME[x]) 2 www.cppforschool.com if (x%2 ==0) NAME[x] = tolower(NAME[x]); else NAME[x] =NAME[x-1]; puts(NAME);