Write a c program to find vowels in a character array?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main (int argc,char **argv)
{
char *a,*b,c;
int t,e;
if (argc<2) return(0);
a=argv[1];
b=a;
e=strlen(b);
for (t=0;t<=e;t++)
{
c = *b;
if (c>='A'&&c<='Z') c -= 'A'-'a';
if (c=='a'c=='e'c=='i'c=='o'c=='u') b++;
else *a++ = *b++;
}
printf ("%s\n",argv[1]);
return(0);
}
What is the algorithm n flowchart for calculating factorial of number using recursion?
A flowchart for factorial of number can be made using different software's. Microsoft Word is the most popular software for beginners to make simple flowcharts.
In order to draw the flowchart write the number at the top of the paper and then draw two lines under it going slightly to the sides. Decide what two numbers can be multiplied to equal that number. Keep going until you can no longer get to smaller numbers.
Print prime numbers between 1 to 100?
#include <stdio.h>
int main (int argc, char **argv) {
int i, j, prime;
for (i=51; i<=99; i+=2) {
prime=1;
for (j=3; j<=i-2; j+=2) {
if (i%j == 0) {
prime=0;
break;
}
}
if (prime) printf ("%d ", i);
}
printf ("\n");
return 0;
}
The standard library provides a complex number type that encapsulates both the real and imaginary parts of a complex number. All arithmetic operators are overloaded to cater for the complex type:
#include<iostream>
#include<complex>
int main()
{
std::complex<double> c {3.14, 4.2}, d {2.1, -1.2};
std::cout << c + d << std::endl;
}
All object-oriented programming languages must have the 3 following features?
Abstraction, encapsulation and polymorphismare the three fundamental features of an object oriented programming language.
Example program arrays in turbo c plus plus?
Yes, you can use for-loop in a C program compiled by Turbo C.
Programme to swap two arrays in C programming?
#include <iostream>
int main()
{
// Declare and initialise an array with two elements.
int A[2]={1,2};
// Output the array values:
std::cout<<"Before swap:\t"<<"A[0]="<<A[0]<<", A[1]="<<A[1]<<std::endl;
// Swap the array values.
A[0]^=A[1]^=A[0]^=A[1];
// Output the array values:
std::cout<<"After swap:\t"<<"A[0]="<<A[0]<<", A[1]="<<A[1]<<std::endl;
return(0);
}
Output:
Before swap: A[0]=1, A[1]=2
After swap: A[0]=2, A[1]=1
How do you convert binary into decimal and vice versa?
Binary to Decimal
Working from the least-significant bit, the positional values are 1, 2, 4, 8, 16, 32, 64 and 128 (each more significant bit doubles the value of the preceding bit). If the corresponding bit is set, add that value to an accumulator initialised to zero.
Decimal to Binary
Repeatedly divide the decimal value by 2 and take the remainder (which can only be 0 or 1). Each division determines the value of the next most significant bit, starting with the least significant bit.
I think you mean operation overlord??? It is the American, Canadian and British offensive on Europe in World War 2. They landed in Normandy on 6th June 1944 (Commonly called D-Day, Day of Days or Deliverance Day) and progressed throughout France liberating Paris on the 25th August. This allowed the allies a foothold in Europe.
Program to concatenate the two strings without using build in functions?
#include<iostream>
#include<string>
int main()
{
using std::string;
string a = "hand";
string b = "bag";
string c = a + b; // concatenation
}
What kind of information is represented by a pointer variable?
It is variable. On most PCs it is either 32 or 64 bits. But it can be smaller on other systems. To find the size use sizeof(void*) .
HISTORY of Turbo C C stands for COMBINED PROGRAMMING LANGUAGE. Sometimes called SYSTEM PROGRAMMING LANGUAGE or SPL. C parallels with UNIX in 1969, by Bell Laboratories that sought an alternative to the Multics operating system for PDP-7 computer. The original version of Multics operating system was written in assembly language.
The reason why the language is called C is that it is the successor to the language called B which was developed by Ken Thompson in 1970 while working on DEC PDP-7. B was the successor the language called BCPL (Basic Combined Programming Language) which was developed by Martin Richards.
The C Language was designed in 1972 by Dennis Ritchie and first implemented at Bell Laboratory using DEC PDP-11 computer.
In 1978 Brian Kernighan and Dennis Ritchie wrote the famous book called THE C PROGRAMMING LANGUAGE.
C is often called a Middle Level Language but has a functionalism of a high-level language and assembly language. C has only 32 keywords (27 from Kernighan and Ritchie standard and 5 added by the ANSI Standardization committee).
Programming is a series of individual instructions to the computer that collectively perform a meaningful task. It is the act of writing or coding computer instructions.
Program Source Code is the finished encoded instructions.
Programmer is the one who write the computer program and the first lady programmer is Lady Augusta "Ada" Byron.
Translator is use to transform the source code into a machine language that the computer can understand.
Linker is use to adjust the translated source file so that the program will run. Linking is usually distinct from the compiling process on a machine running MS-DOS.
What is the definition of 'getch' in c programming?
what is getch()and their use
Function getch waits for a single keypress (without line-buffering and echoing).
In: ncruses.h (unix) or conio.h (dos).
Display numbers from 1 to 10 using for loop?
the following is C code, should work well enough. If not, you should get the general idea.
int counter;
for (int i=1;i<10;i++)
{
println("Enter a number: ");
cin << counter;
}
println("Total, %i", counter);
Difference between integer array and character array?
Arrays are basic structures wherein one or more elements exist "side by side" and are of the same "type". An "integer" array is an array whose elements are all of an integer type which has no fractional component. A "character" array is an array which contains nothing but character types. A "floating point" array contains elements that have both an integer and fractional portion.
Simply put, they are arrays of particular types.
Language Lab is essential for teaching Foreign Languages in Modern Teaching Methods. The system helps to teach any langauge very easily.
1). Professor can communicate simultaneously, with all the students or indivisual student.
2). Indivisual student can discuss with the professor through a call request switch. Call will be registered in the professor's main console.
3). Professor can transmit his views to an individual student or to all the students.
4). Professor can monitor or listen to any student indivisually.
5). Prerecorded Cassette can be broadcasted to an indivisual student or to all.
6). Professor can record his/her voice or pronunciation.
8). For more convenience can be wireless system can be attached to the system, so that the Professor can move freely while teaching.
Definition of merge sort in data structure?
we can sort unordered list to order list. we fallow a mechanism given list divided into two parts take one-one part ordered them
How do you append an item into an array using c?
It is possible, if it is a dynamically allocated array:
int n= 0; Elem *p= NULL;
...
AddElem (Elem newval)
{
n += 1; p = (Elem *)realloc (p, n*sizeof (Elem));
p[n-1] = newval;
}
How t write Recursive C program to find Binomial coefficient?
#include<stdio.h>
int fact(int);
void main()
{
int n,r,f;
printf("enter value for n & r\n");
scanf("%d%d",&n,&r);
if(n<r)
printf("invalid input");
else
f=fact(n)/(fact(n-r)*fact(r));
printf("binomial coefficient=%d",f);
}
int fact(int x)
{
if(x>1)
return x*fact(x-1);
else
return 1;
}
There are some difficulties that a programmer must overcome in writing an operating system . Following are the difficulties
Which type of data refers to things that can be counted?
A quantitative variable is numeric and therefore can be counted discretely or continuously. The other side of the spectrum is qualitative variables.
What is primitive and non primitive cell?
Primitive unit cells use every lattice point as a unit cell vertex.
Non-primitive unit cells, however, contain extra lattice points not at the corners.
How do you add 2 numbers with register machine assembly language?
.model small
.stack
.data
.code
main proc
mov al,10
mov bl,15
add al, bl
start:
mov cx,8
mov bl,'1'
test bl,10000000b
mov ah,09h
int 21h
next:
shl bl,1
mov dl,1
mov ah,09h
int 21h
mov ah,4ch
int 21h
main endp
end start
end