saiswaroop09

A topnotch WordPress.com site

factorial

#include<iostream.h>
long factorial(int);
int main ()
{
int n;
cin>>n;
long sum=0;
for(int i=1;i<=n;++i)
{
cout<<factorial(i)<<” “;
}
//cout<<sum;
}
long factorial (int x)
{
long fact=1;
for(int i=1;i<=x;++i)
fact *=i;
return fact;
}

Leave a comment »

prime or composite number

#include<iostream.h>
int main()
{
int num,flag=1;
cin>>num;
for ( int i=2; i<=num/2; ++i)
{
if(num% i==0)
{
flag=0;
break;
}
}
if(flag==1)
cout<<“prime number”;
else
cout<<“composite number”;
}

Leave a comment »

the sum of first n odd numbers

#include<iostream.h>
int main()
{
int n, sum=0, i=1;
cout<<“Enter value of n :”;
cin>>n;
while(i<=2*n)
{
if(i%2 != 0)
{
sum=sum+i;
}
++i;
}
cout<<“the sum of first “<<n<<” odd number is “<<sum;
}

Leave a comment »

find the sum of first n even numbers

#include<iostream.h>
int main()
{
int n, sum=0, i=2;
cout<<“Enter value of n :”;
cin>>n;
while(i<=n)
{
if(i%2==0)
{
sum=sum+i;
}
++i;
}
cout<<“the sum of first”<<n<<“even number is”<<sum;
}

Leave a comment »

CLOUD COMPUTING

CLOUD COMPUTING

Cloud computing is the use of computing resources (hardware and software) that are delivered as a service over a network (typically the Internet). The name comes from the use of a cloud-shaped symbol as an abstraction for the complex infrastructure it contains in system diagrams. Cloud computing entrusts remote services with a user’s data, software and computation.

There are many types of public cloud computing:

1.Infrastructure as a service (IaaS)                                                                                                                         

  • Essential Characteristics:
  • On-demand self-service. A consumer can unilaterally provision computing capabilities, such as server time and network storage, as needed automatically without requiring human interaction with each service provider.
  • Broad network access. Capabilities are available over the network and accessed through standard mechanisms that promote use by heterogeneous thin or thick client platforms (e.g., mobile phones, tablets, laptops, and workstations).
  • Resource pooling. The provider’s computing resources are pooled to serve multiple consumers using a multi-tenant model, with different physical and virtual resources dynamically assigned and reassigned according to consumer demand. There is a sense of location independence in that the customer generally has no control or knowledge over the exact location of the provided resources but may be able to specify location at a higher level of abstraction (e.g., country, state, or datacenter). Examples of resources include storage, processing, memory, and network bandwidth.
  • Rapid elasticity. Capabilities can be elastically provisioned and released, in some cases automatically, to scale rapidly outward and inward commensurate with demand. To the consumer, the capabilities available for provisioning often appear to be unlimited and can be appropriated in any quantity at any time.
  • Measured service. Cloud systems automatically control and optimize resource use by leveraging a metering capability1 at some level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts).

Deployment Models:

Private cloud. The cloud infrastructure is provisioned for exclusive use by a single organization comprising multiple consumers (e.g., business units). It may be owned, managed, and operated by the organization, a third party, or some combination of them, and it may exist on or off premises.

Community cloud. The cloud infrastructure is provisioned for exclusive use by a specific community of consumers from organizations that have shared concerns (e.g., mission, security requirements, policy, and compliance considerations). It may be owned, managed, and operated by one or more of the organizations in the community, a third party, or some combination of them, and it may exist on or off premises.

Public cloud. The cloud infrastructure is provisioned for open use by the general public. It may be owned, managed, and operated by a business, academic, or government organization, or some combination of them. It exists on the premises of the cloud provider.

Hybrid cloud. The cloud infrastructure is a composition of two or more distinct cloud infrastructures (private, community, or public) that remain unique entities, but are bound together by standardized or proprietary technology that enables data and application portability (e.g., cloud bursting for load balancing between clouds).

Architecture

Cloud computing sample architecture

Cloud architecture,the systems architecture of the software systems involved in the delivery of cloud computing, typically involves multiple cloud components communicating with each other over a loose coupling mechanism such as a messaging queue. Elastic provision implies intelligence in the use of tight or loose coupling as applied to mechanisms such as these and others.

Security

As cloud computing is achieving increased popularity, concerns are being voiced about the security issues introduced through adoption of this new model. The effectiveness and efficiency of traditional protection mechanisms are being reconsidered as the characteristics of this innovative deployment model can differ widely from those of traditional architectures. An alternative perspective on the topic of cloud security is that this is but another, although quite broad, case of “applied security” and that similar security principles that apply in shared multi-user mainframe security models apply with cloud security.

Cloud computing offers many benefits, but it also is vulnerable to threats. As the uses of cloud computing increase, it is highly likely that more criminals will try to find new ways to exploit vulnerabilities in the system. There are many underlying challenges and risks in cloud computing that increase the threat of data being compromised. To help mitigate the threat, cloud computing stakeholders should invest heavily in risk assessment to ensure that the system encrypts to protect data; establishes trusted foundation to secure the platform and infrastructure; and builds higher assurance into auditing to strengthen compliance. Security concerns must be addressed in order to establish trust in cloud computing technology.

REFERENCES:-

1.“The NIST Definition of Cloud Computing”. National Institute of Science and Technology. Retrieved 24 July 2011.

2. en.wikipedia.org/wiki/Cloud computing.

 

Leave a comment »

calculator using switch case

#include<iostream.h>
main()
{
    float num_1, num_2;
    char ch;
    cout<<“Enter first no. :”;
    cin>>num_1;
    cout<<“Enter second no. :”;
    cin>>num_2;
    cout<<“Enter the operator :”;
    cin>>ch;
    switch (ch)
    {
        case ‘+’: cout<<“Addition :”<<num_1+num_2;
                    break;
        case ‘-‘: cout<<“Substraction :”<<num_1-num_2;
                    break;
        case ‘*’: cout<<“Multplication :”<<num_1*num_2;
                    break;
        case ‘/’: cout<<“Divison :”<<num_1/num_2;
                    break;
        default : cout<<“Wrong choice.!”;
}
}

Leave a comment »

calculator

#include<iostream.h>
int main()
{
int a,b,choice,sum,difference,product,division;
cout<<“enter first number”;
cin>>a;
cout<<“enter second number”;
cin>>b;
cout<<“1 for addition,2 for subtraction,3 for multiplication,4 for division”;
cin>>choice;
(choice==’1′);
sum=a+b;
cout<<” the sum is”<<sum;
(choice==’2′);
difference=a-b;
cout<<“the difference is”<<difference;
(choice==’3′);
product=a*b;
cout<<“the product is”<<product;
(choice==’4′);
division=a/b;
if(b==0)
cout<<“invalid”;
else
cout<<“the division is”<<division;
return 0;
}

 

 

Leave a comment »

to obtain larger of two numbers

# include <iostream.h>
int main ()
{
int a,b;
cout<<“enter the 1st number:”;
cin>>a;
cout<<“enter the 2nd number:”;
cin>>b;
if(a>b)
cout<<a<<“is greater than “<<b;
else
cout<<b<<“is greater than “<<a;
return 0 ;
}

Leave a comment »

program to check the number is even or odd

# include <iostream.h>
int main ()
{
int a ;
cout<<“enter a number:”;
cin>>a;
if (a%2==0)
cout<<a<<“is an even number”;
else
cout<<a<<“is an odd number”;
return 0 ;
}

Leave a comment »

to calculate grade of student less than 100

#include<iostream.h>
using namespace std;
int main()
{
int x;
cout<<“enter the marks of x: “;
cin>>x;
if(x>=90 &&x<=100)
cout<<‘a’;
else if(x>=75 &&x<90)
cout<<‘b’;
else if(x>=60 &&x<75)
cout<<‘c’;
else if(x>=45 &&x<60)
cout<<‘d’;
else if(x>=33 &&x<45)
cout<<‘e’;
else if(x>=0 &&x<33)
cout<<‘f’;
else cout<<“invalid input”;
return 0;
}

 

 

Leave a comment »