Write pseudo code to find the biggest of the three numbers?
1. READ the values of 3 numbers A, B and C
2. IF the value of A>that of B THEN
GOTO step 3
ELSE
GOTO step 4
ENDIF
3. IF the value of A>that of C THEN
PRINT "The maximum value is that of A"
GOTO step 5
ELSE
GOTO step 4
ENDIF
4. IF the value of B>that of C THEN
PRINT "The maximum value is that of B"
GOTO step 5
ELSE
PRINT "The maximum value is that of C"
GOTO step 5
ENDIF
5. STOP processing
A B C ' A'B'C' by using truth table?
Oh, what a happy little question! To create a truth table for the expression A B C ' A' B' C', you'll need to list all possible combinations of true (T) and false (F) for the variables A, B, and C. Then, you can apply the logical operations to find the resulting values for the expression. Just take your time, enjoy the process, and soon you'll have a beautiful truth table to admire!
Write about space requirements for variables of different data types?
this is depend upon which processor we are using, 16 bit or 32 bit.
for 16 bit system:
int 2 bytes
short int 2 byte
long int 4 bytes
float 4 bytes
char 1 byte
double 8 bytes
in 32 bit system it takes just double space for int data type.
Write a c program to check whether a number is binary or not?
#include<stdio.h>
void main()
{
int n;
clrscr();
printf("enter a no.");
scanf("%d",&n);
if(n%10==0n%10==1)
printf("yes binary");
else
printf("not binary");
getch();
}
}
Program for print prime all number from 1 to 100 in foxpro?
Oh, what a lovely request! In FoxPro, you can create a program to print all prime numbers from 1 to 100 by using a loop to check each number for divisibility only by 1 and itself. If it meets this criteria, you can print it out on the screen. Remember, every number is unique and special, just like a happy little tree in a vast forest.
What is the Difference between header file and package?
A package is just a mechanism for grouping
objects, it is very similar to grouping items
within a folder or directory on a file system. A class is found within a package, but this does not
have an impact on the class' behavior (review the
"package" access level for a slight exception). An interface, however, is a .java file that is used
(implemented) by another class to tell the outside
world that it conforms to a certain specification. For
example, you might have a "Runnable" interface
that has a "run()" method in it, by having a class that
is "Runnable" (implements Runnable) anyone using that class knows that it must have a "run()" method
defined. This is used when you have several
different classes that have the same interface. Interfaces have more in common with abstract
classes than they do with packages. An interface,
by definition, cannot have any implemented
methods; an abstract class, in contrast, can define
some methods and leave some methods to be
implemented by a subclass. Also, a class can implement many interfaces, but can only extend one
(abstract) class.
Answer by Sahe Alam Ansari, BCA. Nepal bhairahawa. Email: mrsahealam@gmail.com
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
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.
Why c compiler creates exe file?
(Actually, it is the linker, not the compiler.) In most cases, when you write a program, it's not only for your own pleasure, but you actually want to run the program. Well, the runnable format of the program is the exe(cutable).
Write a c program to print the following pyramid 1 121 1231 12321 1234321?
To print the given pyramid pattern in C, you can use nested loops. The outer loop controls the rows, and the inner loop controls the numbers to be printed in each row. Here's a simple C program to achieve this:
#include <stdio.h>
int main() {
int rows = 5;
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= i; j++) {
printf("%d", j);
}
for (int j = i - 1; j >= 1; j--) {
printf("%d", j);
}
printf("\n");
}
return 0;
}
This program will output the desired pyramid pattern.
What numbers have only one array?
1,7,11,
Well, it depends on what you mean by 'the array of a number'. If it has something to do with the divisors, then it's the primes, or the powers of primes.
Write the algorithm and draw the flowchart to find Sum of N Prime number?
Ah, finding the sum of N prime numbers is a lovely challenge! You can create an algorithm by first defining a function to check if a number is prime, then loop through numbers starting from 2 and add the prime numbers to a running sum until you reach N prime numbers. For the flowchart, you can start with a start/end symbol, then use decision symbols to check if a number is prime, loop symbols to iterate through numbers, and a process symbol to calculate the sum. Remember to add symbols for input and output as well. Happy algorithm painting!
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.
What is the difference between predefined functions and user defined functions?
Predefined functions are built-in functions provided by a programming language or software application for common tasks, such as mathematical calculations or string manipulation. User-defined functions are functions created by the programmer to perform specific tasks tailored to the program's requirements. Predefined functions are readily available and can be used without additional coding, while user-defined functions require the programmer to define the function's behavior and implementation.
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.
When the program size is larger than the RAM size how will the program get executed?
The simple answer is it won't execute at all. If a program cannot fit into the system's physical memory (RAM) then it cannot execute, period. The solution is to modularise the program such that the executable is small enough to remain resident while auxiliary functions are placed in more transient libraries that can be freely loaded and unloaded as and when required.
Although virtual memory can make it appear as if your system has far more memory than physically exists in the system, there are still limitations. For example, a 32-bit Windows operating system has a maximum address space of exactly 4 GB (2^32 = 4,294,967,296 bytes), but a single process can only utilise 2 GB at most -- the other 2 GB is reserved for use by the system. Thus the largest executable is limited to no more than 2 GB in size. However, the actual limit is less than 2 GB because the size of the executable on disc is (usually) much lower than its runtime size. This is because every process requires at least one fixed-length call stack (one for each thread of execution in the process) and the process' data segment can generate all zero-initialised static variables, constants and globals at loadtime (they are not stored in the executable, unlike non-zero-initialised statics are), not to mention anonymous variables that are generated on the heap at runtime.
For 64-bit systems, although the theoretical address space is 2^64 = 18,446,744,073,709,551,616 bytes (18 exabytes), that's far more memory than physically exists on the planet! With current technology it is simply not possible to design a system that can accommodate the full complement of memory, thus there has to be a more practical physical limitation. In the case of Windows 10 x64, the physical limit is 2 TB (or 128 GB in the case of Windows 10 Home edition). Even the virtual address space must be limited and this is set at 8 TB for x64 processes (or 7 TB for Intel Itanium-based systems) and 128 TB for Server editions.
What are the limitations of getchar and scanf functions for strings?
cause getchar only read a character and scanf read only word before first space but not other words and letters.
At what time is the sum of the digits on a digital clock the greatest?
The sum of the digits on a digital clock is the greatest when the time is 9:59. At this time, the sum of the digits is 9 + 5 + 9 = 23. This is the highest possible sum because the maximum value for each digit on a digital clock is 9.
How do you draw a flowchart to find the maximum and minimum of three numbers?
1.draw circle and write START
2.draw the parallelogram and pass the input as A,B,C
3.after this draw decision box i.e diamond shape and write(Is A> B) then make two lines attached to the decision box i.e for true or false. 4.if it is true then make another diamond shape and write(Is A> C) and if it is false then make another diamond shape and write(B > C)
5. if the ( A> C) then print number A is maximum or if (B>C) then print number B is maximum
6.and if both the condition are false then display C is maximum number
7.draw the circle and write STOP
this is flow chart to find maximum of 3 number
hope it will helpful for u
thank you
Harshala Kadam
Write an algorithm that can find the maximum of n numbers?
#include void main()
{
int a[10] = { 4, 55, 65, 73, 87, 99, 45, 454, 4353, 243}; int i, j, k, l; for ( j = 9, i = 1, k = 5, l = 6; i <= 2, k >= 3, l<= 7, j >= 8 ; i++, j--, k--, l++)
{
if (a[0] < a[i])
{
a[0] = a[i];
}
if (a[0] < a[j])
{
a[0] = a[j];
}
if (a[0] < a[k])
{
a[0] = a[k];
}
if (a[0] < a[l])
{
a[0] = a[l];
}
} printf("highest number = %d", a[0] );
}
What is all the arrays for 12?
Oh honey, there are so many arrays for 12, it's like trying to count all the wrinkles on my face! Let's see, you've got 1 x 12, 2 x 6, and 3 x 4. But hey, if you want to get fancy, you can also do 4 x 3, 6 x 2, and 12 x 1. Math can be a real party sometimes!
What is the relationship between ICT and computer?
Information and Communication Technology (ICT) is a broad term that encompasses the use of various technologies for communication and data processing. Computers are a key component of ICT, as they are used for processing and storing data, as well as for communication through networks. In essence, computers are a fundamental tool within the realm of ICT, enabling the processing, storage, and transmission of information across various digital platforms.
What is the opposite of primitive?
The opposite of primitive is advanced or sophisticated. Primitive refers to something basic, undeveloped, or in its earliest stage of existence. In contrast, advanced denotes a higher level of complexity, refinement, or progress in a particular field or context.
How to draw Flowchart to print prime numbers from 1 to 100 using while loop in c language?
Oh, dude, drawing a flowchart for printing prime numbers from 1 to 100 using a while loop in C? That's like asking me to explain quantum physics while juggling flaming torches. But hey, you basically start with a start symbol, then draw a decision box to check if a number is prime, and loop back until you reach 100. Just remember to add some arrows and shapes, and you're good to go!
C plus plus program Code for greatest common factor using prime factorization?
#include
#include
#include
void main()
{
int a,b,c;
clrscr();
cout<<"Enter the first no : ";
cin>>a;
cout<<"\nEnter the Second no : ";
cin>>b;
int k=0;
if(a==0)
{
cout<<"\nGCF : "<
}
if(b==0)
{
}
while((a & 1)==0 && (b&1)==0)
{
a>>=1;
b>>=1;
k+=1;
}
do
{
if((a & 1)==0)
{a>>=1;}
else if((b & 1)==0)
{b>>=1;}
else if(a>=b)
{a=(a-b)>>1;}
else
{
b=(b-a)>>1;
}
}while(a>0);
cout<<"\nGCF : "<
getch();
}