Friday, April 10, 2020
Thursday, April 9, 2020
Wednesday, April 8, 2020
Thursday, December 5, 2019
Skill Enhancement Courses (SEC) python language
Question Set 1
- What is high level language?
- Comparison of high level language and machine level language.
- What do you mean by compiler?
- Advantages and disadvantages of flowchart.
- Advantages and disadvantages of algorithm.
- Flowchart/algorithm- i) odd/even checking ii) prime number checking iii) factorial of a number iv) Fibonacci series
- Data type- int, char, float.
- What do you mean by type casting?
- Example of logical operator and bitwise operator.
- Difference between while loop and do-while loop.
- Difference between while loop and for loop.
- Difference between break and continue.
- Difference between variable declaration and variable definition.
- Explain if and nested if.
- Explain loop and nested loop.
- WAP to display the first n terms of Fibonacci series.
- WAP to reverse a number.
- WAP to calculate the sum and product of digit of a number. CLICK
- WAP to display the factorial of a number. CLICK
- WAP to check a number is prime or not. CLICK
- WAP to check a number is perfect or not. CLICK
- WAP to check a number is strong or not. CLICK
- WAP to display the prime numbers in a range. CLICK
- WAP to display the first n perfect numbers.
- WAP to display the first n strong numbers.
- WAP to check a year is leap year or not. CLICK
- WAP to check a number is palindrome or not.
- List- print(), append(), insert().
- List - len(),max(),min().append(),insert().
- Searching in a list.
- Common elements in lists.
Skill Enhancement Courses (SEC) - c language
Question Set - 1
1. What is high level language?
2. Comparison of high level language and machine level language.
3. What do you mean by compiler?
4. Advantages and disadvantages of flowchart.
5. Advantages and disadvantages of algorithm.
6. Size of datatype- int,char,float.
7. Difference between prefix++ and postfix ++.
8. Example of logical operator and bitwise operator.
9. Difference between while loop and do-while loop.
10. Difference between while loop and for loop.
11. Difference between break and continue.
12. Difference between variable declaration and variable definition.
13. What do you mean by subscripted variable.
14. What do you mean by dynamic memory alloaction?
15. Write a c program to swap two values using 3rd variable.
16. Write a c program to swap two values without using 3rd variable.
17. Write a c program to find n!.
18. Write a c program to compute nCr, nPr.
19. Write a c program to largest and smallest number from a set of n numbers using array.
20. Write a c program to sort n numbers in ascending order.
21. Write a c program to sort n numbers in descending order.
22. Write a c program to perform addition,subtraction, multiplication of matrices.
Saturday, September 21, 2019
array insertion deletion using c++
edited by:: Subhrajit Gorai
CMSA 1st sem
source code::
#include<iostream>
#include<conio.h>
using namespace std;
class Array{
int
arr[100],l,e,n;
public:
void
input(){
cout<<"Enter
the length of the array :";
cin>>l;
cout<<"Enter
the elements of the array :\n";
for(int
i=0;i<l;i++)
cin>>arr[i];
}
void
output(){
cout<<"\nThe
elements of the array :\n";
for(int
i=0;i<l;i++)
cout<<arr[i]<<"
, ";
}
void
insert_At_Begin(){
cout<<"\nEnter
the elements to be inserted in the array :\n";
cin>>e;
l++;
for(int
i=l-2;i>=0;i--){
arr[i+1]=arr[i];
}
arr[0]=e;
output();
}
void
del_At_Begin(){
l--;
for(int
i=0;i<l;i++)
arr[i]=arr[i+1];
output();
}
void
insert_At_End(){
cout<<"\nEnter
the elements to be inserted in the array :\n";
cin>>e;
l++;
arr[l-1]=e;
output();
}
void
del_At_End(){
l--;
output();
}
void
insert_At_Index(){
cout<<"Enter
the position of the array where the element is to be inserted :";
cin>>n;
while(n>l||n<0){
cout<<"\nINVALID
POSITION entered........!!!!";
cout<<"\nEnter
the position of the array where the element is to be AGAIN :";
cin>>n;
}
cout<<"\nEnter
the elements to be inserted in the array :\n";
cin>>e;
l++;
--n;
for(int
i=l-2;i>=n;i--){
arr[i+1]=arr[i];
}
arr[n]=e;
output();
}
void
del_At_Index(){
cout<<"\nEnter
the position of the array where the element is to be Deleted :";
cin>>n;
while(n>l||n<0){
cout<<"\nINVALID
POSITION entered........!!!!";
cout<<"\nEnter
the position of the array where the element is to be AGAIN :";
cin>>n;
}
n=n-1;
for(int
i=n;i<l;i++)
arr[i]=arr[i+1];
l--;
output();
}
void
cho(){
int
c;
cout<<"\n\n 1. Insert Element at the Begining.\n 2. Insert Element at the End.\n 3. Insert Element at any desired
position.\n 4. Delete Element at the
Begining.\n 5. Delete Element at the
End.\n 6. Delete Element at any desired
position.\n 7. Exit\n";
cout<<"\nEnter
the choice:";
cin>>c;
switch
(c)
{
case
1:
insert_At_Begin();
break;
case
2:
insert_At_End();
break;
case
3:
insert_At_Index();
break;
case
4:
del_At_Begin();
break;
case
5:
del_At_End();
break;
case
6:
del_At_Index();
break;
case
7: exit(0);
default
:cout<<" Wrong Choice!!!!\n Enter the choice Again.... ";
cho();
}
}
};
int
main(){
int
s=0;
Array
ob;
ob.input();
ob.output();
for(int
k=0;;k++)
ob.cho();
getch();
return
0;
}
output::
Sunday, August 4, 2019
Subscribe to:
Posts (Atom)