11 C Assignments
11 C Assignments
11 C Assignments
#include <iostream.h> void main() { cout << "Hello World!" << endl; } #include <iostream.h> void main() { int a,b; a=5; b=a*a; cout << "The square is " << b; } Header File The main Function (starting and ending point of a C++ program) Body of the function
11. Display the following output on the screen using a single cout statement: C++ A III generation programming language Uses Object Oriented Programming 12. Write a C++ program to input the cost price and selling price of a product and calculate the profit or loss.
13. Write a C++ program to input a number and display the square and cube of that number. 14. Write a C++ program to input temperature in Fahrenheit and convert in to centigrade. c = (5.0/9)*(f-32) 15. Write a prog. to input marks of a student out of 100 & check whether the student is pass or fail. #include<iostream.h> #include<conio.h> void main( ) { int m; cout<<enter the marks; cin>>m; if(m>=33) cout<<Pass; else cout<<Fail; getch(); } 16. Write a prog to input age of a person and check whether the person is eligible to vote or not. 17. Write a prog to input a number and check whether the number is positive or negative. 18. Write a prog to input a number and check whether the number is even or odd. 19. Write a prog to input two numbers and find the greater of the two numbers. 20. Write a program to input a number, if the number is odd print its square and if the number is even print its cube. 21. Write a program to input a number and check whether it is divisible by 5 or not. 22. Write a program to input the monthly salary and calculate the income tax on the following basis. Annual Salary Income Tax >150000 30% 100000 to 150000 20% 50000 to 99999 10% else Nil 23. Write a program to input the marks of 3 subjects and calculate the total and percentage Also the program should display the grade on the following basis. Marks Grade 85 to 100 A 70 to 84 B 55 to 69 C 40 to 54 D less than 40 E 24. Write a program to input the sales and calculate the commission on the following basis. Sales Comm >15000 15% 10000 to 15000 12% 5000 to 9999 10% else 3% (Use switch to do the following programs) 25. Write a program to input a character from the user and check whether it is a vowel or a consonant. 26. Write a program to input a month number (1-12) and display the month name and the number of days in the given month. For example if the month number is 5, The output should be May has 31 days
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search.
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search.
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search.
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search.
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search.
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search.
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search.
1. Write a program to input an array of 10 integers and find the sum and average of these numbers. 2. Write a program to input an array of 10 integers and find the minimum value. 3. Write a program to input an array of 10 integers and change it. At all even positions add 5 to the value and at all odd positions multiply by 2. 4. Write a program to input an array of 10 integers and perform linear search. 3