SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
What is the output of this code? what to put when it prompts to enter the file name? Give specific
replys. Show the demo of the output.
#include<bits/stdc++.h>
#include<fstream>
#include <iostream>
#include<cstdlib>
#include<string.h>
using namespace std;
int c=0;
ifstream fin;
int strcmp_ncase(string s1, string s2)
{
transform(s1.begin(),s1.end(),s1.begin(), ::toupper);
transform(s2.begin(),s2.end(),s2.begin(), ::toupper);
if(s1 == s2)
return 1;
else
return 0;
}
int main()
{
cout<<"Welcome to the Name Searching Programn";
char fil[100];
cout<<"Please enter the name your file: ";
cin>>fil;
fin.open(fil);
while(fin.fail())
{
cout << "I'm sorry, I could not open " << fil <<
" Please enter another name: ";
cin>>fil;
fin.open(fil);
}
cout << "File" << fil << "opened successfullyn";
getchar();
string search;
cout<<"What name would like to find in the file? ";
getline(cin, search);
int flag = 0;
while(!fin.eof())
{
string temp;
c++;
getline(fin,temp);
int x = strcmp_ncase(search,temp);
if(x == 1)
{
cout <<""<< temp << "is the"<<c<<"rd name in the file"<<endl;
flag = 1;
}
}
if(flag == 0)
cout<<search<<"name not found in the filen";
fin.close();
cout<<"Thank you for using he NSPn";
return 0;
}

Weitere ähnliche Inhalte

Ähnlich wie What is the output of this code- what to put when it prompts to enter.pdf

Write a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdfWrite a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdfjillisacebi75827
 
Lab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docx
Lab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docxLab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docx
Lab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docxDIPESH30
 
Shell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfShell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfclarityvision
 
Add an interactive command line to your C++ application
Add an interactive command line to your C++ applicationAdd an interactive command line to your C++ application
Add an interactive command line to your C++ applicationDaniele Pallastrelli
 
lecture-5 string.pptx
lecture-5 string.pptxlecture-5 string.pptx
lecture-5 string.pptxDilanAlmsa
 
Game unleashedjavascript
Game unleashedjavascriptGame unleashedjavascript
Game unleashedjavascriptReece Carlson
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsAlfonso Peletier
 
Can someone explain me the steps pleaseTake the provided files.pdf
Can someone explain me the steps pleaseTake the provided files.pdfCan someone explain me the steps pleaseTake the provided files.pdf
Can someone explain me the steps pleaseTake the provided files.pdfinfo189835
 
3 1. preprocessor, math, stdlib
3 1. preprocessor, math, stdlib3 1. preprocessor, math, stdlib
3 1. preprocessor, math, stdlib웅식 전
 
C++ course start
C++ course startC++ course start
C++ course startNet3lem
 
Dns server clients (actual program)
Dns server clients (actual program)Dns server clients (actual program)
Dns server clients (actual program)Youssef Dirani
 
Dns server clients (actual program)
Dns server clients (actual program)Dns server clients (actual program)
Dns server clients (actual program)Youssef Dirani
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++Neeru Mittal
 

Ähnlich wie What is the output of this code- what to put when it prompts to enter.pdf (20)

Write a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdfWrite a C++ program 1. Study the function process_text() in file.pdf
Write a C++ program 1. Study the function process_text() in file.pdf
 
Lab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docx
Lab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docxLab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docx
Lab01Filesbuild.bat@echo offclsset DRIVE_LETTER=1.docx
 
Computer Programming- Lecture 6
Computer Programming- Lecture 6Computer Programming- Lecture 6
Computer Programming- Lecture 6
 
Shell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfShell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdf
 
Add an interactive command line to your C++ application
Add an interactive command line to your C++ applicationAdd an interactive command line to your C++ application
Add an interactive command line to your C++ application
 
Unix Programs
Unix ProgramsUnix Programs
Unix Programs
 
lecture-5 string.pptx
lecture-5 string.pptxlecture-5 string.pptx
lecture-5 string.pptx
 
Game unleashedjavascript
Game unleashedjavascriptGame unleashedjavascript
Game unleashedjavascript
 
Sbaw091006
Sbaw091006Sbaw091006
Sbaw091006
 
20DCE096_prac8.pdf
20DCE096_prac8.pdf20DCE096_prac8.pdf
20DCE096_prac8.pdf
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
 
Can someone explain me the steps pleaseTake the provided files.pdf
Can someone explain me the steps pleaseTake the provided files.pdfCan someone explain me the steps pleaseTake the provided files.pdf
Can someone explain me the steps pleaseTake the provided files.pdf
 
C++11
C++11C++11
C++11
 
3 1. preprocessor, math, stdlib
3 1. preprocessor, math, stdlib3 1. preprocessor, math, stdlib
3 1. preprocessor, math, stdlib
 
C++ course start
C++ course startC++ course start
C++ course start
 
Dns server clients (actual program)
Dns server clients (actual program)Dns server clients (actual program)
Dns server clients (actual program)
 
Dns server clients (actual program)
Dns server clients (actual program)Dns server clients (actual program)
Dns server clients (actual program)
 
Tugas 2
Tugas 2Tugas 2
Tugas 2
 
MUST CS101 Lab11
MUST CS101 Lab11 MUST CS101 Lab11
MUST CS101 Lab11
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++
 

Mehr von JoshuaQ1NReesh

What makes an organism alive- what are the characteristics of life- Is.pdf
What makes an organism alive- what are the characteristics of life- Is.pdfWhat makes an organism alive- what are the characteristics of life- Is.pdf
What makes an organism alive- what are the characteristics of life- Is.pdfJoshuaQ1NReesh
 
What is the variance in Table 1- Table 1- Raw data of hospital emergen.pdf
What is the variance in Table 1- Table 1- Raw data of hospital emergen.pdfWhat is the variance in Table 1- Table 1- Raw data of hospital emergen.pdf
What is the variance in Table 1- Table 1- Raw data of hospital emergen.pdfJoshuaQ1NReesh
 
What is the World Economic Forum- Who is the founder- There is a divid.pdf
What is the World Economic Forum- Who is the founder- There is a divid.pdfWhat is the World Economic Forum- Who is the founder- There is a divid.pdf
What is the World Economic Forum- Who is the founder- There is a divid.pdfJoshuaQ1NReesh
 
What is the total assets- Determine the total assets for the period fr.pdf
What is the total assets- Determine the total assets for the period fr.pdfWhat is the total assets- Determine the total assets for the period fr.pdf
What is the total assets- Determine the total assets for the period fr.pdfJoshuaQ1NReesh
 
What is the total expense for the period- The following information is.pdf
What is the total expense for the period- The following information is.pdfWhat is the total expense for the period- The following information is.pdf
What is the total expense for the period- The following information is.pdfJoshuaQ1NReesh
 
What is the significance of the image below-Represent the deposition o.pdf
What is the significance of the image below-Represent the deposition o.pdfWhat is the significance of the image below-Represent the deposition o.pdf
What is the significance of the image below-Represent the deposition o.pdfJoshuaQ1NReesh
 
What is the statistical term for moderation- Repeated group effect Int.pdf
What is the statistical term for moderation- Repeated group effect Int.pdfWhat is the statistical term for moderation- Repeated group effect Int.pdf
What is the statistical term for moderation- Repeated group effect Int.pdfJoshuaQ1NReesh
 
what is the primary purpose of financial accounting - what is the prim.pdf
what is the primary purpose of financial accounting - what is the prim.pdfwhat is the primary purpose of financial accounting - what is the prim.pdf
what is the primary purpose of financial accounting - what is the prim.pdfJoshuaQ1NReesh
 
What is the present value of the following cash flows at a rate of 4-8.pdf
What is the present value of the following cash flows at a rate of 4-8.pdfWhat is the present value of the following cash flows at a rate of 4-8.pdf
What is the present value of the following cash flows at a rate of 4-8.pdfJoshuaQ1NReesh
 
What is the net profit- Assume the following information was made avai.pdf
What is the net profit- Assume the following information was made avai.pdfWhat is the net profit- Assume the following information was made avai.pdf
What is the net profit- Assume the following information was made avai.pdfJoshuaQ1NReesh
 
What is the major difference between a population and a sample in a re.pdf
What is the major difference between a population and a sample in a re.pdfWhat is the major difference between a population and a sample in a re.pdf
What is the major difference between a population and a sample in a re.pdfJoshuaQ1NReesh
 
What is the main difference between onboarding and training- Onboardin.pdf
What is the main difference between onboarding and training- Onboardin.pdfWhat is the main difference between onboarding and training- Onboardin.pdf
What is the main difference between onboarding and training- Onboardin.pdfJoshuaQ1NReesh
 
What is the journal entry when the company pays $800 cash on accounts.pdf
What is the journal entry when the company pays $800 cash on accounts.pdfWhat is the journal entry when the company pays $800 cash on accounts.pdf
What is the journal entry when the company pays $800 cash on accounts.pdfJoshuaQ1NReesh
 
What is the difference between sterilisation and disinfection- Name th.pdf
What is the difference between sterilisation and disinfection- Name th.pdfWhat is the difference between sterilisation and disinfection- Name th.pdf
What is the difference between sterilisation and disinfection- Name th.pdfJoshuaQ1NReesh
 
What is the complete code for this problem- Create a KakuroCSP solver.pdf
What is the complete code for this problem- Create a KakuroCSP solver.pdfWhat is the complete code for this problem- Create a KakuroCSP solver.pdf
What is the complete code for this problem- Create a KakuroCSP solver.pdfJoshuaQ1NReesh
 
What is scikit learn in python used for--The components of the scikit.pdf
What is scikit learn in python used for--The components of the scikit.pdfWhat is scikit learn in python used for--The components of the scikit.pdf
What is scikit learn in python used for--The components of the scikit.pdfJoshuaQ1NReesh
 
What is included in the resources system developed by ASOS to supports.pdf
What is included in the resources system developed by ASOS to supports.pdfWhat is included in the resources system developed by ASOS to supports.pdf
What is included in the resources system developed by ASOS to supports.pdfJoshuaQ1NReesh
 
What is the complete code for this problem- DON'T POST A MISSING CODE.pdf
What is the complete code for this problem-  DON'T POST A MISSING CODE.pdfWhat is the complete code for this problem-  DON'T POST A MISSING CODE.pdf
What is the complete code for this problem- DON'T POST A MISSING CODE.pdfJoshuaQ1NReesh
 
What is a measure of the status of redox reactions in a given water- W.pdf
What is a measure of the status of redox reactions in a given water- W.pdfWhat is a measure of the status of redox reactions in a given water- W.pdf
What is a measure of the status of redox reactions in a given water- W.pdfJoshuaQ1NReesh
 
What is a controlled experiment- Uses both a training group and a cont.pdf
What is a controlled experiment- Uses both a training group and a cont.pdfWhat is a controlled experiment- Uses both a training group and a cont.pdf
What is a controlled experiment- Uses both a training group and a cont.pdfJoshuaQ1NReesh
 

Mehr von JoshuaQ1NReesh (20)

What makes an organism alive- what are the characteristics of life- Is.pdf
What makes an organism alive- what are the characteristics of life- Is.pdfWhat makes an organism alive- what are the characteristics of life- Is.pdf
What makes an organism alive- what are the characteristics of life- Is.pdf
 
What is the variance in Table 1- Table 1- Raw data of hospital emergen.pdf
What is the variance in Table 1- Table 1- Raw data of hospital emergen.pdfWhat is the variance in Table 1- Table 1- Raw data of hospital emergen.pdf
What is the variance in Table 1- Table 1- Raw data of hospital emergen.pdf
 
What is the World Economic Forum- Who is the founder- There is a divid.pdf
What is the World Economic Forum- Who is the founder- There is a divid.pdfWhat is the World Economic Forum- Who is the founder- There is a divid.pdf
What is the World Economic Forum- Who is the founder- There is a divid.pdf
 
What is the total assets- Determine the total assets for the period fr.pdf
What is the total assets- Determine the total assets for the period fr.pdfWhat is the total assets- Determine the total assets for the period fr.pdf
What is the total assets- Determine the total assets for the period fr.pdf
 
What is the total expense for the period- The following information is.pdf
What is the total expense for the period- The following information is.pdfWhat is the total expense for the period- The following information is.pdf
What is the total expense for the period- The following information is.pdf
 
What is the significance of the image below-Represent the deposition o.pdf
What is the significance of the image below-Represent the deposition o.pdfWhat is the significance of the image below-Represent the deposition o.pdf
What is the significance of the image below-Represent the deposition o.pdf
 
What is the statistical term for moderation- Repeated group effect Int.pdf
What is the statistical term for moderation- Repeated group effect Int.pdfWhat is the statistical term for moderation- Repeated group effect Int.pdf
What is the statistical term for moderation- Repeated group effect Int.pdf
 
what is the primary purpose of financial accounting - what is the prim.pdf
what is the primary purpose of financial accounting - what is the prim.pdfwhat is the primary purpose of financial accounting - what is the prim.pdf
what is the primary purpose of financial accounting - what is the prim.pdf
 
What is the present value of the following cash flows at a rate of 4-8.pdf
What is the present value of the following cash flows at a rate of 4-8.pdfWhat is the present value of the following cash flows at a rate of 4-8.pdf
What is the present value of the following cash flows at a rate of 4-8.pdf
 
What is the net profit- Assume the following information was made avai.pdf
What is the net profit- Assume the following information was made avai.pdfWhat is the net profit- Assume the following information was made avai.pdf
What is the net profit- Assume the following information was made avai.pdf
 
What is the major difference between a population and a sample in a re.pdf
What is the major difference between a population and a sample in a re.pdfWhat is the major difference between a population and a sample in a re.pdf
What is the major difference between a population and a sample in a re.pdf
 
What is the main difference between onboarding and training- Onboardin.pdf
What is the main difference between onboarding and training- Onboardin.pdfWhat is the main difference between onboarding and training- Onboardin.pdf
What is the main difference between onboarding and training- Onboardin.pdf
 
What is the journal entry when the company pays $800 cash on accounts.pdf
What is the journal entry when the company pays $800 cash on accounts.pdfWhat is the journal entry when the company pays $800 cash on accounts.pdf
What is the journal entry when the company pays $800 cash on accounts.pdf
 
What is the difference between sterilisation and disinfection- Name th.pdf
What is the difference between sterilisation and disinfection- Name th.pdfWhat is the difference between sterilisation and disinfection- Name th.pdf
What is the difference between sterilisation and disinfection- Name th.pdf
 
What is the complete code for this problem- Create a KakuroCSP solver.pdf
What is the complete code for this problem- Create a KakuroCSP solver.pdfWhat is the complete code for this problem- Create a KakuroCSP solver.pdf
What is the complete code for this problem- Create a KakuroCSP solver.pdf
 
What is scikit learn in python used for--The components of the scikit.pdf
What is scikit learn in python used for--The components of the scikit.pdfWhat is scikit learn in python used for--The components of the scikit.pdf
What is scikit learn in python used for--The components of the scikit.pdf
 
What is included in the resources system developed by ASOS to supports.pdf
What is included in the resources system developed by ASOS to supports.pdfWhat is included in the resources system developed by ASOS to supports.pdf
What is included in the resources system developed by ASOS to supports.pdf
 
What is the complete code for this problem- DON'T POST A MISSING CODE.pdf
What is the complete code for this problem-  DON'T POST A MISSING CODE.pdfWhat is the complete code for this problem-  DON'T POST A MISSING CODE.pdf
What is the complete code for this problem- DON'T POST A MISSING CODE.pdf
 
What is a measure of the status of redox reactions in a given water- W.pdf
What is a measure of the status of redox reactions in a given water- W.pdfWhat is a measure of the status of redox reactions in a given water- W.pdf
What is a measure of the status of redox reactions in a given water- W.pdf
 
What is a controlled experiment- Uses both a training group and a cont.pdf
What is a controlled experiment- Uses both a training group and a cont.pdfWhat is a controlled experiment- Uses both a training group and a cont.pdf
What is a controlled experiment- Uses both a training group and a cont.pdf
 

Kürzlich hochgeladen

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...liera silvan
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 

Kürzlich hochgeladen (20)

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
EmpTech Lesson 18 - ICT Project for Website Traffic Statistics and Performanc...
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 

What is the output of this code- what to put when it prompts to enter.pdf

  • 1. What is the output of this code? what to put when it prompts to enter the file name? Give specific replys. Show the demo of the output. #include<bits/stdc++.h> #include<fstream> #include <iostream> #include<cstdlib> #include<string.h> using namespace std; int c=0; ifstream fin; int strcmp_ncase(string s1, string s2) { transform(s1.begin(),s1.end(),s1.begin(), ::toupper); transform(s2.begin(),s2.end(),s2.begin(), ::toupper); if(s1 == s2) return 1; else return 0; } int main() { cout<<"Welcome to the Name Searching Programn"; char fil[100]; cout<<"Please enter the name your file: "; cin>>fil; fin.open(fil); while(fin.fail()) { cout << "I'm sorry, I could not open " << fil << " Please enter another name: "; cin>>fil; fin.open(fil); }
  • 2. cout << "File" << fil << "opened successfullyn"; getchar(); string search; cout<<"What name would like to find in the file? "; getline(cin, search); int flag = 0; while(!fin.eof()) { string temp; c++; getline(fin,temp); int x = strcmp_ncase(search,temp); if(x == 1) { cout <<""<< temp << "is the"<<c<<"rd name in the file"<<endl; flag = 1; } } if(flag == 0) cout<<search<<"name not found in the filen"; fin.close(); cout<<"Thank you for using he NSPn"; return 0; }