Q.18. Write the name of Identity Operators?
Q.19. Write a program to find greater number among 3 numbers.
Q.20. Predict the output of following code:
my_list ['p', 'r, 'o', 'b', T, 'e, 'm']
a.
my_list[2:3]-1
print(my_list)
y str(123)
b.
x= "Step"*3
print( x, y)
i1
C
whilei=7):
i*=2
print)
Q.21. Write a program to input a string and print number of upper and lower case letters in
it.
Q.22. Write a program to input a list and search element and search for an element in list of
number.
Q.23. Write a program to input the value of x and n and print the sum of the series
s = = 1+x+x+x3 +x
Answers
// Loop to print the N terms
// Loop to print the N terms // of the series and find their sum
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) {
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) {
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi;
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi; cout << multi << " ";
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi; cout << multi << " "; multi = multi * x;
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi; cout << multi << " "; multi = multi * x; }
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi; cout << multi << " "; multi = multi * x; }
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi; cout << multi << " "; multi = multi * x; } cout << "\n";
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi; cout << multi << " "; multi = multi * x; } cout << "\n"; return total;
// Loop to print the N terms // of the series and find their sum for (i = 1; i < n; i++) { total = total + multi; cout << multi << " "; multi = multi * x; } cout << "\n"; return total; }
// Driver code
// Driver code int main()
// Driver code int main() {
// Driver code int main() { int x = 2;
// Driver code int main() { int x = 2; int n = 5;
// Driver code int main() { int x = 2; int n = 5; cout << fixed
// Driver code int main() { int x = 2; int n = 5; cout << fixed << setprecision(2)
// Driver code int main() { int x = 2; int n = 5; cout << fixed << setprecision(2) << sum(x, n);
// Driver code int main() { int x = 2; int n = 5; cout << fixed << setprecision(2) << sum(x, n); return 0;
// Driver code int main() { int x = 2; int n = 5; cout << fixed << setprecision(2) << sum(x, n); return 0; }