Pages in PDF | Wipro previous year question paper solution
Pages in PDF | Wipro previous year question paper solution Problem:-
An online printing application has a special way after printing pages in a PDF file. A maximum of 9 lines can be printed on one page the application manager wishes to analyze how many pages have an even number of lines printed on the PDF . for this purpose the number of lines printed on each page of the PDF file is gathered as a concatenated string. The number of digits in the string represents the number of pages in the PDF and each digits the number of lines printing on that page of the PDF.
Write an algorithm to find the pages with an even number of lines printed on them.
Input
the first line off the input consist of a string numlines, representing the number of lines printed on each page
output:- Print a string representing the number of pages with n even number of lines printed on them , without spaces in the same order as in the input string . If no page has even lines then print “NA”;
Example;-
input:-
33423968
Output:-
4268
Code:-
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int f=0; for(int i=0;s[i];i++) { // 48 is the ascii of 0 // when we substract 48 // it will convert it into int data type int a=s[i]-48; if(a%2==0) { f=1; cout<<s[i]; } } // if there is no even line if(f==0) cout<<"NA"; return 0; }
Output:-
33423968 4268
Recommended Post:
-
codechef problems:-
Wipro :-
- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID
Infytq :-
Key Points;-
Hackerrank:-
- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution
C-tutorial:-
- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array
See more:-
- c program to convert specified days into years weeks and days
- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation
New Slot Machines to Offer in New Orleans, Louisiana – JamBase
New slot machines to offer 전라북도 출장마사지 in New 광명 출장마사지 Orleans, Louisiana 안양 출장안마 New 인천광역 출장안마 slot machines to 인천광역 출장안마 offer in New Orleans, Louisiana.