Vous êtes sur la page 1sur 8

Program to sort number in ascending order

#include <stdio.h>
int main()
{
int arr[100];
int size, i, j, temp;
/*
* Read size of array and elements in array
*/
printf("Enter size of array: ");
scanf("%d", &size);
printf("Enter elements in array: ");
for(i=0; i<size; i++)
{
scanf("%d", &arr[i]);
}
/*
* Array sorting code
*/
for(i=0; i<size; i++)
{
for(j=i+1; j<size; j++)
{
/*
* If there is a smaller element towards right of the array
then swap it.
*/
if(arr[j] < arr[i])
{
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
/*
* Prints the sorted array
*/
printf("\nElements of array in sorted ascending order: ");
for(i=0; i<size; i++)
{
printf("%d\t", arr[i]);
}
return 0;
}

Q.2 Is C or C++ advantageous and why?


C is definitely simpler to implement. However, it has a few limitations as it is restricted to a certain
level as functions are to be defined over and over again to be implemented.
On the other hand C++ implements the use of modules which introduces a non-linear mode of
operation. This was the foundation of Graphical User Interface (GUI) when more than one course of

action is possible, unlike C.


You can say that the better among the two is C++.
Most programs are written in C because of the simplicity and easy readability
Q.3

String reverse using strrev in c programming language

#include<stdio.h>
#include<string.h>
int main(){
char str[50];
char *rev;
printf("Enter any string : ");
scanf("%s",str);
rev = strrev(str);
printf("Reverse string is : %s",rev);
return 0;
}
Q.4 Frequency Reuse :
Frequency reuse is the practice of splitting an area into smaller regions that do not overlap
so that each utilizes the full range of frequencies without interference. The introduction of
this concept was a major step in the development of mobile phone technology.
Q.5 Stop Band
A stopband is a band of frequencies, between specified limits, through which a circuit, such
as a filter or telephone circuit, does not allow signals to pass, or the attenuation is above the
required stopband attenuation level.
Q.6 Sampling
In signal processing, sampling is the reduction of a continuous signal to a discrete signal.
A common example is the conversion of a sound wave (a continuous signal) to a sequence
of samples (a discrete-time signal). A sample is a value or set of values at a point in time
and/or space.
Q.7 GPRS

General Packet Radio Service (GPRS) is a packet oriented mobile data service on
the 2G and 3G cellular communication system's global system for mobile communications(GSM).
GPRS can be used to enable connections depending on Internet protocols that support a wide
variety of enterprises, as well as commercial applications. It enables the sending and receiving of
compact data bursts and large data volumes across mobile phone networks. Prior to sending the
data, it is broken into individual packets and shifted through the core network and radio. The data
is then reassembled at the recipient's end.

Q.8 Bluetooth
Bluetooth is a similar radio-wave technology, but it's mainly designed for communicating over short
distances less than about 10m or 30ft. Bluetooth sends and receives radio waves in a band of 79
different frequencies (channels) centered on 2.45 GHz, set apart from radio, television, and
cellphones, and reserved for use by industrial, scientific, and medical gadgets. because they don't
travel far, are theoretically more secure than wireless networks that operate over longer ranges, such
as Wi-Fi.
Q.9 Write a program on factorial

1. #include<stdio.h>
2. int main(){
3.
int i,f=1,num;
4.
5.
printf("Enter a number: ");
6.
scanf("%d",&num);
7.
8.
for(i=1;i<=num;i++)
9.
f=f*i;
10.
11. printf("Factorial of %d is: %d",num,f);
12. return 0;
13. }

Q.10 C program to find the smallest number from an array

#include<stdio.h>
int main() {
int a[30], i, num, smallest;
printf("\nEnter no of elements :");
scanf("%d", &num);
//Read n elements in an array
for (i = 0; i < num; i++)
scanf("%d", &a[i]);
//Consider first element as smallest
smallest = a[0];
for (i = 0; i < num; i++) {
if (a[i] < smallest) {
smallest = a[i];
}
}
// Print out the Result
printf("\nSmallest Element : %d", smallest);

return (0);
}
Q.11 Prime number

#include<stdio.h>
int main(){
int num,i,count=0;
printf("Enter a number: ");
scanf("%d",&num);
for(i=2;i<=num/2;i++){
if(num%i==0){
count++;
break;
}
}
if(count==0 && num!= 1)
printf("%d is a prime number",num);
else
printf("%d is not a prime number",num);
return 0;
}
Q.13 Fibonacci series
#include<stdio.h>
int main()
{
int n, first = 0, second = 1, next, c;
printf("Enter the number of terms\n");
scanf("%d",&n);
printf("First %d terms of Fibonacci series are :-\n",n);
for ( c = 0 ; c < n ; c++ )
{
if ( c <= 1 )
next = c;
else
{
next = first + second;
first = second;
second = next;
}
printf("%d\n",next);
}

return 0;
}

Q. 12 What is operating System and Platform

A computing platform is the stage where computer programs run. An operating system
sits between applications and hardware, managing how applications access hardware
and software resources. This means that an operating system is a kind of computing
platform, but a computing platform is not necessarily a kind of operating system. A
runtime library can also be a computing platform.
I think Raymond Deng puts it very well.
Another example would be Android.
Android is a platform and an Operating System. If you took away the Java stuff, it would
stop being the Android platform, but it would remain an Operating System
(GNU/Linux).
Or Mac OS X, take away Cocoa/Quartz and other Apple frameworks, it stops being the
Mac platform, but it remains an Operating System.
Or you can have a platform which isnt an OS at all, like the web, its a stage as
Raymond puts it, which web applications run on, but a web browser isnt an Operating
System.
So lots of overlap, i.e. generally an Operating System is a platform, and generally a
platform is an Operating System, but you can have one without the other too.
I would say Windows in a operating system while a Mac is a platform.
An OS is pure software while a platform is the combination between the OS and the kind
of hardware, especially the CPU, it runs on.
A computer platform is a system that consists of a hardware device and an operating system
that an application, program or process runs upon. An example of a computer platform is a
desktop computer with Microsoft Windows installed on it. A desktop is a hardware device and
Windows is an operating system.
The operating system acts as an interface between the computer and the user and also between
the computer and the application. So, in order to have a functional device, you need hardware
and an operating system together to make a usable computer platform for a program to run on.
The hardware portion of a computer platform consists of a processor, memory, and storage. The
processor is a bit like your brain and memory is like a scratchpad for your brain to use while
you're working out a problem.
It used to be that people referred to different computer platforms by their physical size, from
smallest to largest - microcomputers (smallest), minicomputers (mid-size), and mainframes
(largest). The term microcomputer has fallen somewhat out of favor - now most people just refer
to these machines as computers or personal computers.

Q.13 Memory Leak


There are two definitions (at least for me):

Naive one: Failure to release unreachable memory, which can no longer be allocated
again by any process during execution of allocating process. It can mostly be cured by
using GC techniques or detected by automated tools.
Subtle one: Failure to release reachable memory, which is no longer needed for your
program to function correctly. It is nearly impossible to be detected by automated tools
or programmers who is not too familiar with the code. While technically it is not a leak, it
has the same implications of the naive one. This is not my own idea only. You can come
across projects that are written in a garbage collected language but still mentions fixing
memory leaks in their changelogs.
Q.14 what happens when there is memory overflow?
Stackoverflow
Q.15 how do we add up memory if we don't have any other physical memory present
Virtual Memory
Q.16 So a collection of lot of Virtual memory is called what ?
Cloud
Q.17 How many types of Cloud are there?
Public, Private, Hybrid.

Public Clouds
A public cloud is basically the internet. Service providers use the internet to make
resources, such as applications (also known as Software-as-a-service) and storage,
available to the general public, or on a public cloud. Examples of public clouds include
Amazon Elastic Compute Cloud (EC2), IBMs Blue Cloud, Sun Cloud, Google
AppEngine and Windows Azure Services Platform.
For users, these types of clouds will provide the best economies of scale, are
inexpensive to set-up because hardware, application and bandwidth costs are covered
by the provider. Its a pay-per-usage model and the only costs incurred are based on
the capacity that is used.
There are some limitations, however; the public cloud may not be the right fit for every
organization. The model can limit configuration, security, and SLA specificity, making it
less-than-ideal for services using sensitive data that is subject to compliancy
regulations.
Private Clouds

Private clouds are data center architectures owned by a single company that provides
flexibility, scalability, provisioning, automation and monitoring. The goal of a private
cloud is not sell as-a-service offerings to external customers but instead to gain the
benefits of cloud architecture without giving up the control of maintaining your own data
center.
Private clouds can be expensive with typically modest economies of scale. This is
usually not an option for the average Small-to-Medium sized business and is most
typically put to use by large enterprises. Private clouds are driven by concerns around
security and compliance, and keeping assets within the firewall.
Hybrid Clouds
By using a Hybrid approach, companies can maintain control of an internally managed
private cloud while relying on the public cloud as needed. For instance during peak
periods individual applications, or portions of applications can be migrated to the Public
Cloud. This will also be beneficial during predictable outages: hurricane warnings,
scheduled maintenance windows, rolling brown/blackouts.
Q. 15 Modulation used by Televesion
All analog television systems use vestigial sideband modulation, a form of
amplitude modulation in which one sideband is partially removed. This reduces the
bandwidth of the transmitted signal, enabling narrower channels to be used.

Q.16 Microprocessor and Microcontroller


A microprocessor generally does not have Ram, ROM and IO pins. It usually
uses its pins as a bus to interface to peripherals such as RAM, ROM, Serial
ports, Digital and Analog IO. It is expandable at the board level due to this.
A microcontroller is 'all in one', the processor, ram, IO all on the one chip, as
such you cannot (say) increase the amount of RAM available or the number
of IO ports. The controlling bus is internal and not available to the board
designer.
This means that a microprocessor is generally capable of being built into
bigger general purpose applications than a microcontroller. The
microcontroller is usually used for more dedicated applications.
Q. 17 Sensor. A sensor is a device which is capable of converting any physical quantity to
be measured into a signal which can be read, displayed, stored or used to

Vous aimerez peut-être aussi