Professional Documents
Culture Documents
Assignment 1 Mca Id Adsa
Assignment 1 Mca Id Adsa
Maximum Marks: 64
Date of Allotment: 01/09/2023
Date of Submission: 05/9/2023
Note: Late submissions will not be accepted and will be given zero marks.
3. To understand basic concepts about stacks, queues, lists, trees and graphs.
4. To understanding about wri ng algorithms and step by step approach in solving problems with
Instruc ons:
2. Illustrate your answers with suitable examples and diagrams, wherever necessary.
3. Write a program to take two integers as input and print all prime numbers between them.
4. Write a program to take 5 numbers as input and find LCM of those numbers.
5. Explain Big-O, Big-Omega, Big-Theta with examples and graphs and find Big-O, Big-Omega, Big-Theta for
f(n)=n*(log(n))^2 + 1000000*n + 7645.
void fun(int n)
{
int c=0;
while(n>=1)
{
n=n/12;
c++;
}
cout<<c;
}
int main()
{
int n;
for(int i=1;i<n;i=i*12)
{
fun(i);
}
int sum=0;
int j=0;
while(sum<=n)
{
j++;
sum=sum+j;
}
return 0;
}
void fun(int n)
{
int c=0;
while(n>=1)
{
n=n/6;
c++;
}
cout<<c;
}
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i=i*3)
{
for(int j=1; j<=i*i;j++)
{
fun(i+j)
}
}
int k=0;
while(k<n)
{
k=k+2;
}
return 0;
}
int fun(int n)
{
int c=0;
while(n>=1)
{
n=n/6;
c++;
}
return c;
}
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=1; j<=fun(i);j++)
{
for(int k=1;k<(n/2);k++)
{
cout<<"Elina"<<" ";
}
}
}
return 0;
}
2. Take a floating point number as input and replace the after decimal and before decimal parts by reverse of
before decimal and reverse of after decimal respectively. Example: if n=243.12 then ans=21.342, if
n=654.976 then ans=679.456
3. Write a program to input a positive integer n and check if it can be expressed as A^P where P > 1 and A > 0.
A and P both should be integers. Example; if n=8 then output=yes(8=2^3), if n=18 then output=no.