Write a program in c to print first ten prime numbers?
#include<stdio.h>
#include<conio.h>
int main()
{
int a;
printf("the no from 1 to 10 are:\n");
for(a=1;a<=10;a++)
printf("%d\n", a);
getch();
}
Sure thing, honey. An identifying relationship of a weak entity type can definitely have a degree greater than two. For example, let's say we have a weak entity type called "Order Item" that depends on both "Order" and "Product" entities to uniquely identify it. In this case, the identifying relationship would have a degree of two (connecting "Order" and "Product") but the weak entity type itself would have a degree of three. Hope that clears things up for ya!
Advantages and disadvantages of mechanical data processing?
Advantages- Speed
- Analyse large amounts of data
- Takes less time
Disadvantages
- Complexity of the code can cause problems
- Programs are liable to bugs which may effect the data
These are but a few reasons
What are the difference between MS Word and QBasic?
Microsoft Word is a word processing software used for creating, editing, and formatting text documents, while QBasic is a programming language primarily used for writing and running simple programs. MS Word is designed for creating documents such as letters, reports, and resumes, while QBasic is used for developing small applications and games. Additionally, MS Word has a graphical user interface for ease of use, while QBasic requires writing code for programming tasks.
What is development of application?
Development of mobile application is the process in which application software is created for handhold electronic devices such as mobile phones, iPhone and iPad. These applications are pre-installed on phones during manufacturing, or can be downloaded from different mobile software distribution platforms. These innovative mobile applications can enhance the functionality of your mobile phones. An experienced mobile application development company can help you to build custom apps for your Smartphone, which meets your requirements. Contact Onseeker.com to get best and affordable mobile applications.
What is the difference between application software and programming language?
A script is a code fragment, rather than a complete or standalone application. Examples include commands in a command line language or code in a web page.
The definition of a scripting language is a programming language that is most typically used in a script setting. This means that they are usually interpreted rather than compiled languages, and are often dynamically typed.
Application programming languages include ones like C++ and Java.
Scripting languages include ones like the Unix shell languages and Javascript.
Languages such as Basic and Ruby are more difficult to characterize. They have often been used to write complete applications, but because they are interpreted, have also been utilized as script languages (for example the use of VBScript in spreadsheets).
also refer this link: http://home.pacbell.net/ouster/scripting.html
Write a program to print the Fibonacci series 0 1 1 2 3 5 8-------20?
fibbonacci starts out as 1,1,2,3,5,8,13,21,34....meaning 1 + 1 = 2, 2 +1 = 3, 3+2 = 5 and so on the solution in C++.
#include <iostream>
using namespace std;
int main()
{
short a = 1;
short b = 1;
short c = 2;
do
{
a = c + b;
cout << a << "\n";
b = a + c;
cout << b << "\n";
c = b + a;
cout << c << "\n";
}while (a && b && c != 34);
return 0;
}
in this i used short int because, i was only going to go up to 34 to keep things short an simple.
I then figured out in what order i would have to figure out my variables on paper. I assigned values to my variables to have a starting point then used a do-while to loop the program. I made sure that my varibles were all checked against 34 so it would have a break point and not run on forever.
Frame Sorting Program using C?
Basically the frame are sent from the sender side by assigning a frame id,which could be a number.During the transmission of frames across the link the frames can be transmitted out of order w.r.t the frame id assigned to each of the frame.
The frames need to be in order to maintain integrity.
Even though the frames are sent in order,during the transmission the frames may experience delay or routing or any other event which can shuffle the order.
Thus frame sorting is done at the receiver side at the buffer at the DATA Link layer
before sending it to the higher layers.
The sorting can be done in many sorting techniques like bubble sort,merge sort etc.
Simple framesort code in C#include#include
#include
#include
struct frame
{
char preamble[5];
char dest[48];
char src[48];
int length;
char data[256];
char crc[32];
int seqno;
};
struct frame f[50];
struct frame temp;
int number;
int i,j;
char inputstring[500];
int datasize=5;
void displayinformation()
{
int k=0;
for(k=0;k<=number;k++)
printf("%s",f[k].data);
printf("\n\n");
}
void read()
{
int i=0,j=0,k=0;
char dest[50],src[50];
printf("\nEnter src address : ");
gets(src);
printf("\nEnter dest address : ");
gets(dest);
printf("\nEnter the information : ");
gets(inputstring);
int inputlength=strlen(inputstring);
i=0;
j=0;
f[i].seqno=0;
strcpy(f[i].src,src);
strcpy(f[i].dest,dest);
while(k<=inputlength)
{
f[i].data[j]=inputstring[k++];
if(++j>=datasize)
{
i++;
f[i].seqno=i;
f[i-1].length=datasize;
strcpy(f[i].src,src);
strcpy(f[i].dest,dest);
j=0;
}
}
f[i].length=strlen(f[i].data);
number=i+1;
if(f[i].length==0)
number--;
}
void displayframes()
{
int j;
printf("\n");
for(j=0;j { if(j==0) { printf("Seq No\t\tDest\t\t\tSrc\t\t\tData\t\tLength\n"); printf("---------------------------------------------------------------------------------------\n"); } printf("%d\t\t%s\t\t%s\t\t%s\t\t%d\n",f[j].seqno,f[j].dest,f[j].src,f[j].data,f[j].length); } } void shuffle() { int i=0,l,p; i=number; while(--i>=0) { l=rand()%number; p=rand()%number; temp=f[l]; f[l]=f[p]; f[p]=temp; } } void bubblesortframes() { for(i=0;i { for(j=0;j { if(f[j].seqno>f[j+1].seqno) { temp=f[j]; f[j]=f[j+1]; f[j+1]=temp; } } } } int main() { read(); printf("\n\nInformation at sender\n"); printf("%s",inputstring); printf("\nFrame at sender \n"); displayframes(); shuffle(); printf("\n---\nFrame at receiver\n"); displayframes(); printf("\nInformation received at reciever\n"); displayinformation(); bubblesortframes(); printf("\n---\nFrames at receiver after sorting\n"); displayframes(); printf("\nInformation at receiver after sorting\n"); displayinformation(); return 0; Enter dest address : 176.16.1.44 Enter the information : Mysore boy rocks. Information at sender Mysore boy rocks. Frame at sender Seq No Dest Src Data Length --------------------------------------------------------------------------------------- 0 176.16.1.44 176.16.1.12 Mysor 5 1 176.16.1.44 176.16.1.12 e boy 5 2 176.16.1.44 176.16.1.12 rock 5 3 176.16.1.44 176.16.1.12 s. 2 --- Frame at receiver Seq No Dest Src Data Length --------------------------------------------------------------------------------------- 3 176.16.1.44 176.16.1.12 s. 2 1 176.16.1.44 176.16.1.12 e boy 5 0 176.16.1.44 176.16.1.12 Mysor 5 2 176.16.1.44 176.16.1.12 rock 5 Information received at reciever s.e boyMysor rock --- Frames at receiver after sorting Seq No Dest Src Data Length --------------------------------------------------------------------------------------- 0 176.16.1.44 176.16.1.12 Mysor 5 1 176.16.1.44 176.16.1.12 e boy 5 2 176.16.1.44 176.16.1.12 rock 5 3 176.16.1.44 176.16.1.12 s. 2 Information at receiver after sorting Mysore boy rocks. #include struct frame{ int num; char str[20]; }; struct frame arr[10]; int n; void sort() /*Bubble sort */ { int i,j; struct frame temp; for(i=0;i for(j=0;j if(arr[j].num>arr[j+1].num) { temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } int main() { int i; system("clear"); printf("Enter the number of frames\n"); scanf("%d",&n); printf("Enter the frame sequence number and frame contents\n"); for(i=0;i scanf("%d%s",&arr[i].num,&arr[i].str); sort(); printf("The frame in sequences\n"); for(i=0;i printf("%d\t%s\n",arr[i].num,arr[i].str); } Mr. Gauro Nepal Engineering and Technical Science Academy Birendranagar, Surkhet Nepal
What are the advantages and disadvantages of Unstructured programming?
advange:
1.speed
disadvantage
1.debugging is tough
2.no reusability
How many values can store a variable at a time?
The number of values a variable can store at a time depends on the data type of the variable. For example, a variable of type int (integer) in many programming languages can store a single integer value at a time. Similarly, a variable of type float (floating-point number) can store a single floating-point value. Other data types like arrays or lists can store multiple values at a time. The capacity of a variable to store values is determined by its data type and memory allocation.
The consequences if a connection fails Five devices arranged in a mesh topology?
If five devices arranged in a mesh topology so we will have 10 links and 4 I/O ports in each hardware device. If any link goes down from them so it will be easy to find out which one is down and it won't effect on other links. But a bulk of wires and can create problem in re-installation and re-configuration.
What is similarities between interface and classes?
The similarities are:
a. They are both java basic object types
b. They both can contain variables and methods (With difference being class methods have implementation code whereas the interface methods can only have declarations)
c. They can both be inherited using Inheritance (extends keyword for classes and implements keyword for interfaces)
W difference between a linear linked list and a circular linked list?
I would say that there is no such thing as a circular queue. The point of a circular data structure is to allow the end to loop around to the beginning. Since you can only remove items from the beginning of a queue or add them to the front, having these two items linked has no purpose nor benefit.
Advantages and disadvantages of pseudo-code?
Pseudocode Advantages
Pseudocode Disadvantages
What is the name of kernel in Unix Linux and Windows Vista?
As Unix isn't any particular operating system, there is no distinct name for the kernel. Different versions of Unix may have vastly different kernel structures.
The Linux kernel is called, well, the Linux kernel.
The Vista kernel is a continuation of the "NT kernel" designed for Windows NT 3.1.
What are the different symbol use in flow chart?
Os fluxogramas utilizam uma variedade de símbolos padrão para representar diferentes tipos de atividades, processos, decisões e fluxos de informações. Esses símbolos facilitam a compreensão do fluxo de trabalho ou processo representado. Aqui estão os símbolos mais comuns usados em fluxogramas:
Significado: Início ou Fim de um processo.
Uso: Indica onde o processo começa e onde termina.
Exemplo: "Iniciar" ou "Fim".
Significado: Representa uma etapa ou atividade do processo.
Uso: Descreve ações específicas que precisam ser executadas.
Exemplo: "Enviar e-mail", "Calcular valor".
Significado: Ponto de decisão, geralmente com opções como "Sim" ou "Não".
Uso: Representa bifurcações no processo com base em condições ou perguntas.
Exemplo: "Pagamento aprovado?" → "Sim" ou "Não".
Significado: Indica a direção e sequência do fluxo do processo.
Uso: Conecta os elementos do fluxograma para mostrar o caminho do processo.
Exemplo: Uma seta conectando "Início" a uma etapa seguinte.
Significado: Representa entrada ou saída de informações.
Uso: Para ações como receber ou fornecer dados.
Exemplo: "Inserir dados" ou "Exibir relatório".
Significado: Conector dentro do mesmo fluxograma.
Uso: Para indicar a continuidade do fluxo em uma área diferente do diagrama.
Exemplo: Usado quando o fluxograma é muito longo e precisa ser segmentado.
Significado: Conector para outra página ou outro fluxograma.
Uso: Quando o processo se conecta a outro sistema ou diagrama.
Exemplo: "Continuar no fluxograma B".
Significado: Representa uma etapa que é detalhada em um subprocesso separado.
Uso: Para simplificar fluxogramas complexos.
Exemplo: "Processar pedido" (detalhado em outro fluxograma).
Esses símbolos são padronizados por organizações como a ANSI (American National Standards Institute) e a ISO (International Organization for Standardization), garantindo que fluxogramas sejam consistentes e compreensíveis universalmente. Ferramentas de software, como Microsoft Visio, Lucidchart e até PowerPoint, geralmente seguem esses padrões.
How do you map the object oriented concept using non object oriented languages?
Object oriented programming doesn't strictly require an object-oriented programming language (although those are generally best suited for the job).
Object orientation, as a concept, means to create logical representations of physical or conceptual items: a vehicle, a person, a manager, etc. Each object type (commonly called a class) has a bundle of attributes (data items, properties) and verbs (methods, functions). These bundles, together, form the class.
It is thus possible to create constructs very close to modern classes as those known in C++ using structures in C. In fact, the first C++ compilers (~20 years ago) translated C++ into C, then used an existing C compiler to generate executable code.
In C, a structure can
Among the many standard object-oriented techniques which can not be modeled in C are
That said, object orientation as a design concept does not require an object oriented language.
Write a c program to find out the prime numbers between 1 to 500?
Here is a simple program to generate prime numbers upto a given specific number
/*Prime No. from 1 to 50*/
/*By-Himanshu Rathee*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf(" Enter the number upto which we have to find the prime number: ");
scanf("%d",&n);
printf("\n");
for(i=2;i<=n;i++)
{
for(j=2;j<=i-1;j++)
if(i%j==0)
break;
/*Number is divisble by some other number. So break out*/
if(i==j)
printf("\t%d",i);
/*Number was divisible by itself (that is, i was same as j)*/
}
/*Continue loop upto nth number*/
getch();
}
What is a computer program written in English language called?
Pseudocode. However, pseudocode is not a programming language as such. It is a language that a programmer uses specifically to convey the concept of a specific algorithm to other programmers. The language is such that any programmer can easily translate the algorithm into their preferred language. Furthermore, pseudocode does not have to be written in English, it can be written in any language. However, English is the most widely-spoken language within the programming community and is therefore the most prevalent language used in programming.
The Delphi programming language is currently owned by Embarcadero.
Q2 Differentiate between formatted and unformatted you input and output functions?
Formatted I/P functions: These functions allow us to supply the input in a fixed format and let us obtain the output in the specified form. Formatted output converts the internal binary representation of the data to ASCII characters which are written to the output file. Formatted input reads characters from the input file and converts them to internal form.
Format specifications
Data type
Integer
short signed
short unsigned
long signed
long unsigned
unsigned hexadecimal
unsigned octal
%d or %l
%u
%ld
%lu
%x
%o
Real
float
double
%f
%lf
Character
signed character
unsigned character
%c
%c
String
%s
Unformatted I/O functions: There are several standard library functions available under this category-those that can deal with a string of characters. Unformatted Input/Output is the most basic form of input/output. Unformatted input/output transfers the internal binary representation of the data directly between memory and the file
What similarities between analog and digital signals?
ANALOG:continuous,rate of transmission is slow,less reliable 2 transmit,more noise,interference is more
DIGITAL:non continuous,rate of transmission is fast,more reliable 2 transmit,less noise,interference is less
Computer users who are not computer professionals are sometimes called?
Computer users who are not computer professionals are often referred to as "end users" or "casual users." They typically use computers for basic tasks like browsing the internet, using office applications, or consuming media, without having specialized technical skills. In some contexts, they may also be called "lay users" or "non-technical users."
Step form algorithm for making a telephone call to your friend?
Step1. Start procedure
Step 2. Pick up the phone
Step 3. Search for a friend phone number in the contact list
Step 4. Select the number and dail it by clicking the dail button
Step 5. Wiat for the network
Step 6. If connection is successful you will hear the dailer ring tone.
Distinguish between determinate error and indeterminate error?
Indeterminate errors are random errors that randomly fluctuate and cannot be eliminated.
Determinate errors