Search This Blog

Tuesday, September 24, 2013

DOEACC O / A / B / C Result For July 2013

An Exciting News for NIELIT(formerly known as DOEACC) Students and that is the result of DOEACC O/A/B/C LEVEL theory examination is going to be declared by end of this month.It is expected that the result will be declared till 26 sept. 2013.

Keep in touch with the link given below :-
Click Here for the result.


Saturday, September 14, 2013

What is Artificial Intelligence

hello friends, After a very long period , Now i am back to my blog and here to share some important aspect of new technology which is the part of 5th generation computer system . Artificial intelligence is emerging issue in the field of computer science and now it has become the important brach of comupter science .


All of us know that the stage in which we are working with computer systems is the 5th stage of computer systems .5th generation computers are still in developmental stage which is based on the artificial intelligence and so , we can say that these system will have the capicity to think , learn as human do.

we will often use the shortform AI. AI stands for artificial intelligence. 


now we should move to the topic named AI Application , so that the concept which i will describe , can easily be understood. ok lets see AI Applications :-


          Games:
You can see the use of artificial intelligence in computer while playing games . One of the best example the demonstrate the AI in computer system  is that playing chess game against computer. these programes are designed to play at different difficulty level against human being.You can see artificial telligence used in small games like tic tac toe
 
Now a days there are a lot games , which are developed with the feature of artificial intelligence.

Weather Forecasting:  
Neural networks are used for predicting weather conditions. Previous data is fed to a neural network which learns the pattern and uses that knowledge to predict weather patterns.

Finance: 
Banks use intelligent software applications to screen and analyze financial data. Software programs that can predict trends in the stock market have been created which have been known to beat humans in predictive power.
 
Heavy Industries and Space:  
Robotics and cybernetics have taken a leap combined with artificially intelligent expert systems. An entire manufacturing process is now totally automated, controlled and maintained by a computer system in car manufacture, machine tool production, computer chip production and almost every high-tech process. They carry out dangerous tasks like handling hazardous radioactive materials. Robotic pilots carry out complex maneuvering techniques of unmanned spacecrafts sent in space. Japan is the leading country in the world in terms of robotics research and use.

          Speech recognition:
In the 1990s, computer speech recognition reached a practical level for limited purposes. Thus United Airlines has replaced its keyboard tree for flight information by a system using speech recognition of flight numbers and city names. It is quite convenient. On the the other hand, while it is possible to instruct some computers using speech, most users have gone back to the keyboard and the mouse as still more convenient. 
  

Definations of AI

Artificial intelligence (AI) is technology and a branch of computer science that studies and develops intelligent machines and software

The theory and development of computer systems able to perform tasks that normally require human intelligence, such as visual perception, speech recognition, decision-making, and translation between languages

It is the science and engineering of making intelligent machines.
 
Artificial intelligence allows computers to learn from experience, recognize patterns in large amounts of complex data and make complex decisions based on human knowledge and reasoning skills.
 
Artificial intelligent is the study of the systems which can be made to act in a manner which we would be inclined to call intelligent.
 
Its enough for now , but i promise that next time i will be here with some new aspect of artificial intelligence like braches of AI etc.

Thursday, May 31, 2012

String operation in c language

strlen()

The "strlen()" function gives the length of a string, not including the NULL character at the end:
   /* strlen.c */
 
   #include <stdio.h>
   #include <string.h>
 
   void main()
   {
     char *t = "XXX";
     printf( "Length of <%s> is %d.\n", t, strlen( t ));
   }
This prints:
   Length of <XXX> is 3.

 strcpy()

The "strcpy" function copies one string from another. For example:
   /* strcpy.c */
 
   #include <stdio.h>
   #include <string.h>
 
   void main()
   {
     char s1[100],
          s2[100];
     strcpy( s1, "string 1" );
     strcpy( s2, "string 2" );
 
     puts( "Original strings: " );
     puts( "" );
     puts( s1 );
     puts( s2 );
     puts( "" );
 
     strcpy( s2, s1 );
 
     puts( "New strings: " );
     puts( "" );
     puts( s1 );
     puts( s2 );
   }
This will print:
   Original strings:

   string 1
   string 2

   New strings:

   string 1
   string 1
Please be aware of two features of this program:
  • This program assumes that "s1" has enough space to store the final string. The "strcpy()" function won't bother to check, and will give erroneous results if that is not the case.
  • A string constant can be used as the source string instead of a string variable. Using a string constant for the destination, of course, makes no sense.
These comments are applicable to most of the other string functions.

 strncpy()

There is a variant form of "strcpy" named "strncpy" that will copy "n" characters of the source string to the destination string, presuming there are that many characters available in the source string. For example, if the following change is made in the example program:
   strncpy( s2, s1, 5 );
-- then the results change to:
   New strings:

   string 1
   string
Notice that the parameter "n" is declared "size_t", which is defined in "string.h".

 strcat()

The "strcat()" function joins two strings:
   /* strcat.c */
 
   #include <stdio.h>
   #include <string.h>
 
   void main()
   {
     char s1[50],
          s2[50];
     strcpy( s1, "Tweedledee " );
     strcpy( s2, "Tweedledum" );
     strcat( s1, s2 );
     puts( s1 );
   }
This prints:
   Tweedledee Tweedledum

 strncat()

There is a variant version of "strcat()" named "strncat()" that will append "n" characters of the source string to the destination string. If the example above used "strncat()" with a length of 7:
   strncat( s1, s2, 7 );
-- the result would be:
   Tweedledee Tweedle
Again, the length parameter is of type "size_t".

strcmp()

The "strcmp()" function compares two strings:
   /* strcmp.c */
 
   #include <stdio.h>
   #include <string.h>
 
   #define ANSWER "blue"
 
   void main()
   {
     char t[100];
     puts( "What is the secret color?" );
     gets( t );
     while ( strcmp( t, ANSWER ) != 0 )
     {
       puts( "Wrong, try again." );
       gets( t );
     }
     puts( "Right!" );
   }
The "strcmp()" function returns a 0 for a successful comparison, and nonzero otherwise. The comparison is case-sensitive, so answering "BLUE" or "Blue" won't work.
There are three alternate forms for "strcmp()":

 strncmp()

  • A "strncmp()" function which, as might be guessed, compares "n" characters in the source string with the destination string:
 "strncmp( s1, s2, 6 )".

 stricmp()

  • A "stricmp()" function that ignores case in comparisons.

strnicmp()

  • A case-insensitive version of "strncmp" called "strnicmp".

strchr()

The "strchr" function finds the first occurrence of a character in a string. It returns a pointer to the character if it finds it, and null if not. For example:
   /* strchr.c */
 
   #include <stdio.h>
 
   #include <string.h>
 
   void main()
   {
     char *t = "MEAS:VOLT:DC?";
     char *p;
     p = t;
     puts( p );
     while(( p = strchr( p, ':' )) != NULL )
     {
       puts( ++p );
     }
   }
This prints:
   MEAS:VOLT:DC?
   VOLT:DC?
   DC?
The character is defined as a character constant, which C regards as an "int". Notice how the example program increments the pointer before using it ("++p") so that it doesn't point to the ":" but to the character following it.

strrchr()

The "strrchr()" function is almost the same as "strchr()", except that it searches for the last occurrence of the character in the string.

 strstr()

The "strstr()" function is similar to "strchr()" except that it searches for a string, instead of a character. It also returns a pointer:
  char *s = "Black White Brown Blue Green";
  ...
  puts( strstr( s, "Blue" ) );

 strlwr() and strupr()

The "strlwr()" and "strupr()" functions simply perform lowercase or uppercase conversion on the source string. For example:
   /* casecvt.c */
 
   #include <stdio.h>
   #include <string.h>
 
   void main()
   {
     char *t = "Hey Barney hey!";
     puts( strlwr( t ) );
     puts( strupr( t ) );
   }
-- prints:
   hey barney hey!
   HEY BARNEY HEY!

These two functions are only implemented in some compilers and are not part of ANSI C.

introduction to array in c

What is an Array in C Language?

An array in C Programing Language can be defined as number of memory locations, each of which can store the same data type and which can be references through the same variable name.
An array is a collective name given to a group of similar quantities. These similar quantities could be percentage marks of 100 students, number of chairs in home, or salaries of 300 employees or ages of 25 students. Thus an array is a collection of similar elements. These similar elements could be all integers or all floats or all characters etc. Usually, the array of characters is called a “string”, where as an array of integers or floats is called simply an array. All elements of any given array must be of the same type i.e we can’t have an array of 10 numbers, of which 5 are ints and 5 are floats.
Arrays and pointers have a special relationship as arrays use pointers to reference memory locations.

Declaration of an Array

Arrays must be declared before they can be used in the program. Standard array declaration is as

type variable_name[lengthofarray];
 
Here type specifies the variable type of the element which is going to be stored in the array. In C programmin language we can declare the array of any basic standard type which C language supports. For example

double height[10];
float width[20];
int min[9];
char name[20];
 
In C Language, arrays starts at position 0. The elements of the array occupy adjacent locations in memory. C Language treats the name of the array as if it were a pointer to the first element This is important in understanding how to do arithmetic with arrays. Any item in the array can be accessed through its index, and it can be accesed any where from with in the program. So
m=height[0];
variable m will have the value of first item of array height.
The program below will declare an array of five integers and print all the elements of the array.

int myArray [5] = {1,2,3,4,5};
/* To print all the elements of the array
for (int i=0;i<5;i++){
   printf("%d", myArray[i]);
}

Initializing Arrays

Initializing of array is very simple in c programming. The initializing values are enclosed within the curly braces in the declaration and placed following an equal sign after the array name. Here is an example which declares and initializes an array of five elements of type int. Array can also be initialized after declaration. Look at the following C code which demonstrate the declaration and  initialization of an array.

int myArray[5] = {1, 2, 3, 4, 5}; //declare and initialize the array in one statement
int studentAge[4];
studentAge[0]=14;
studentAge[1]=13;
studentAge[2]=15;
studentAge[3]=16;

Performing operations on Arrays

Here is a program that will demonstrate the simple operations of the array.

#include <stdio.h>
void oneWay(void);
void anotherWay(void);
int main(void) {
   printf("\noneWay:\n");
   oneWay();
   printf("\nantherWay:\n");
   anotherWay();
}

/*Array initialized with aggregate */
void oneWay(void) {
   int vect[10] = {1,2,3,4,5,6,7,8,9,0};
   int i;
   for (i=0; i<10; i++){
       printf("i = %2d vect[i] = %2d\n", i, vect[i]);
   }
}

/*Array initialized with loop */
void anotherWay(void) {
   int vect[10];
   int i;
   for (i=0; i<10; i++)
        vect[i] = i+1;
   for (i=0; i<10; i++)
        printf("i = %2d vect[i] = %2d\n", i, vect[i]);
}

/* The output of this program is
   oneWay:
   i = 0 vect[i] = 1
   i = 1 vect[i] = 2
   i = 2 vect[i] = 3
   i = 3 vect[i] = 4
   i = 4 vect[i] = 5
   i = 5 vect[i] = 6
   i = 6 vect[i] = 7
   i = 7 vect[i] = 8
   i = 8 vect[i] = 9
   i = 9 vect[i] = 0

   antherWay:
   i = 0 vect[i] = 1
   i = 1 vect[i] = 2
   i = 2 vect[i] = 3
   i = 3 vect[i] = 4
   i = 4 vect[i] = 5
   i = 5 vect[i] = 6
   i = 6 vect[i] = 7
   i = 7 vect[i] = 8
   i = 8 vect[i] = 9
   i = 9 vect[i] = 10
   */
Here is a more complex program that will demonstrate how to read, write and traverse the integer arrays

#include <stdio.h>
void intSwap(int *x, int *y);
int getIntArray(int a[], int nmax, int sentinel);
void printIntArray(int a[], int n);
void reverseIntArray(int a[], int n);

int main(void) {
   int x[10];
   int hmny;

   hmny = getIntArray(x, 10, 0);
   printf("The array was: \n");
   printIntArray(x,hmny);
   reverseIntArray(x,hmny);
   printf("after reverse it is:\n");
   printIntArray(x,hmny);
}

void intSwap(int *x, int *y)
/* It swaps the content of x and y */
{
   int temp = *x;
   *x = *y;
   *y = temp;
}

/* n is the number of elements in the array a.
* These values are printed out, five per line. */
void printIntArray(int a[], int n){
   int i;
   for (i=0; i<n; ){
      printf("\t%d ", a[i++]);
      if (i%5==0)
        printf("\n");
   }
   printf("\n");
}

/* It reads up to nmax integers and stores then in a; sentinel
* terminates input. */
int getIntArray(int a[], int nmax, int sentinel)
{
   int n = 0;
   int temp;

   do {
     printf("Enter integer [%d to terminate] : ", sentinel);
     scanf("%d", &temp);
     if (temp==sentinel) break;
     if (n==nmax)
       printf("array is full\n");
     else
     a[n++] = temp;
   }while (1);
   return n;
}

/* It reverse the order of the first n elements of array */
void reverseIntArray(int a[], int n)
{
   int i;
   for(i=0;i<n/2;i++){
     intSwap(&a[i],&a[n-i-1]);
   }
}

Copy one array into another

There is no such statement in C language which can directly copy an array into another array. So we have to copy each item seperately into another array.

#include <stdio.h>
int main()
{
   int iMarks[4];
   short newMarks[4];
   iMarks[0]=78;
   iMarks[1]=64;
   iMarks[2]=66;
   iMarks[3]=74;
   for(i=0; i<4; i++)
     newMarks[i]=iMarks[i];
   for(j=0; j<4; j++)
     printf("%d\n", newMarks[j]);
   return 0;
}
To summarize, arrays are provides a simple mechanism where more than one elements of same type are to be used. We can maintain, manipulate and store multiple elements of same type in one array variable and access them through index.

Sunday, December 11, 2011

test on c

Q1.
main()
{
int i;
clrscr();
printf("%d", &i)+1;
scanf("%d", i)-1;
}

a. Runtime error.

b. Runtime error. Access violation.
c. Compile error. Illegal syntax
d. None of the above





Ans: d,printf( ) prints address/garbage of i,

scanf() dont hav & sign, so scans address for i
+1, -1 dont hav any effect on code

Q2.

main(int argc, char *argv[])
{
 (main && argc) ? main(argc-1, NULL) : return 0;
}

a. Runtime error.

b. Compile error. Illegal syntax
c. Gets into Infinite loop
d. None of the above



Ans: b) illegal syntax for using return


Q3.

main()
{
 int i;
 float *pf;
 pf = (float *)&i;
*pf = 100.00;
 printf("
%d", i);
}

a. Runtime error.

b. 100
c. Some Integer not 100
d. None of the above




Ans: d) 0


Q4.


main()

{
 int i = 0xff ;
 printf("
%d", i<<2);
}

a. 4

b. 512
c. 1020
d. 1024




Ans: c) 1020



Q5.

#define SQR(x) x * x

main()

{
 printf("%d", 225/SQR(15));
}

a. 1

b. 225
c. 15
d. none of the above



Ans: b) 225



Q6.

union u
{
 struct st
{
 int i : 4;
 int j : 4;
 int k : 4;
 int l;
}st;
int i;
}u;

main()

{
 u.i = 100;
 printf("%d, %d, %d",u.i, u.st.i, u.st.l);
}

a. 4, 4, 0

b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0



Ans: c) 100, 4, 0


Q7.

union u
{
 union u
 {
 int i;
 int j;
 }a[10];
 int b[10];
}u;

main()

{
 printf("
%d", sizeof(u));
 printf(" %d", sizeof(u.a));
// printf("%d", sizeof(u.a[4].i));
}

a. 4, 4, 4

b. 40, 4, 4
c. 1, 100, 1
d. 40 400 4


Ans: 20, 200, error for 3rd printf


Q8.

main()
{
 int (*functable[2])(char *format, ...) ={printf, scanf};
 int i = 100;

(*functable[0])("%d", i);

 (*functable[1])("%d", i);
 (*functable[1])("%d", i);
 (*functable[0])("%d", &i);

}


a. 100, Runtime error.

b. 100, Random number, Random number, Random number.
c. Compile error
d. 100, Random number



Q9.

main()
{
 int i, j, *p;
 i = 25;
 j = 100;
 p = &i; // Address of i is assigned to pointer p
 printf("%f", i/(*p) ); // i is divided by pointer p
}

a. Runtime error.

b. 1.00000
c. Compile error
d. 0.00000




Ans: c) Error becoz i/(*p) is 25/25 i.e 1 which is int & printed as a float,

So abnormal program termination,
runs if (float) i/(*p) -----> Type Casting

Q10.

main()
{
 int i, j;
 scanf("%d %d"+scanf("%d %d", &i, &j));
 printf("%d %d", i, j);
}

a. Runtime error.

b. 0, 0
c. Compile error
d. the first two values entered by the user



Ans: d) two values entered, 3rd will be null pointer assignment


Q11.


main()

{
 char *p = "hello world";
 p[0] = 'H';
 printf("%s", p);
}

a. Runtime error.

b. "Hello world
c. Compile error
d. "hello world




Ans: b) Hello world


Q12.

main()
{
 char * strA;
 char * strB = I am OK;
 memcpy( strA, strB, 6);
}

a. Runtime error.

b. I am OK
c. Compile error
d. I am O



Ans: c) I am OK is not in " "



Q13. How will you print % character?

a. printf("\%)
b. printf("\%)
c. printf("%%)
d. printf("\%%)


Ans: c) printf(" %% ");


Q14.

const int perplexed = 2;
#define perplexed 3

main()

{
 #ifdef perplexed
 #undef perplexed
 #define perplexed 4
 #endif
 printf("%d",perplexed);
}

a. 0

b. 2
c. 4
d. none of the above



Ans: c)


Q15.

struct Foo
{
 char *pName;
};

main()

{
 struct Foo *obj = malloc(sizeof(struct Foo));
 clrscr();
 strcpy(obj->pName,"Your Name");
 printf("%s", obj->pName);
}

a. Your Name

b. compile error
c. Name
d. Runtime error




Ans a)


Q16.

struct Foo
{
 char *pName;
 char *pAddress;
};

main()

{
 struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
 obj->pName = malloc(100);
 obj->pAddress = malloc(100);

strcpy(obj->pName,"Your Name");

 strcpy(obj->pAddress, "Your Address");

free(obj);

 printf("%s", obj->pName);
 printf("%s", obj->pAddress);
}

a. Your Name, Your Address

b. Your Address, Your Address
c. Your Name Your Name
d. None of the above






Ans: d) printd Nothing, as after free(obj), no memory is there containing

obj->pName & pbj->pAddress

Q17.

main()
{
 char *a = "Hello ";
 char *b = "World";
clrscr();
 printf("%s", strcat(a,b));
}

a. Hello

b. Hello World
c. HelloWorld
d. None of the above




Ans: b)


Q18.


main()

{
 char *a = "Hello ";
 char *b = "World";
 clrscr();
 printf("%s", strcpy(a,b));
}

a. "Hello

b. "Hello World
c. "HelloWorld
d. None of the above







Ans: d) World, copies World on a, overwrites Hello in a.


Q19.

void func1(int (*a)[10])
{
 printf("Ok it works");
}

void func2(int a[][10])

{
 printf("Will this work?");
}

main()
{
 int a[10][10];
 func1(a);
 func2(a);
}

a. Ok it works

b. Will this work?
c. Ok it worksWill this work?
d. None of the above







Ans: c)


Q20.

main()
{
 printf("%d, %d", sizeof('c'), sizeof(100));
}

a. 2, 2

b. 2, 100
c. 4, 100
d. 4, 4





Ans: a) 2, 2


Q21.

main()
{
 int i = 100;
 clrscr();
 printf("%d", sizeof(sizeof(i)));
}

a. 2

b. 100
c. 4
d. none of the above




Ans: a) 2


Q22.  


main()

{
 int c = 5;
 printf("%d", main||c);
}

a. 1

b. 5
c. 0
d. none of the above



Ans: a) 1, if we use main|c then error, illegal use of pointer



Q23.

main()
{
 char c;
 int i = 456;
 clrscr();
 c = i;
 printf("%d", c);
}

a. 456

b. -456
c. random number
d. none of the above







Ans: d) -56


Q24.

void main ()
{
 int x = 10;
 printf ("x = %d, y = %d", x,--x++);
}

a. 10, 10

b. 10, 9
c. 10, 11
d. none of the above






Ans: d) Lvalue required


Q25.

main()
{
 int i =10, j = 20;
 clrscr();
 printf("%d, %d, ", j-- , --i);
 printf("%d, %d ", j++ , ++i);
}

a. 20, 10, 20, 10

b. 20, 9, 20, 10
c. 20, 9, 19, 10
d. 19, 9, 20, 10







Ans: c)


Q26.


main()

{
 int x=5;
 clrscr();

for(;x==0;x--) {

 printf("x=%d
", x--);
 }
}

a. 4, 3, 2, 1, 0

b. 1, 2, 3, 4, 5
c. 0, 1, 2, 3, 4
d. none of the above





Ans: d) prints nothing, as condition x==0 is False


Q27

main()
{
 int x=5;

for(;x!=0;x--) {

 printf("x=%d
", x--);
 }
}

a. 5, 4, 3, 2,1

b. 4, 3, 2, 1, 0
c. 5, 3, 1
d. none of the above







Ans: d) Infinite loop as x is decremented twice, it never be 0

and loop is going on & on

Q28
main()
{
 int x=5;
 clrscr();

for(;x<= 0;x--)

{
 printf("x=%d ", x--);
 }
}
a. 5, 3, 1
b. 5, 2, 1,
c. 5, 3, 1, -1, 3
d. "3, -1, 1, 3, 5




Ans: prints nothing, as condition in loop is false.


Q29.

main()
{
 {
 unsigned int bit=256;
 printf("%d", bit);
 }
 {
 unsigned int bit=512;
 printf("%d", bit);
 }
}

a. 256, 256

b. 512, 512
c. 256, 512
d. Compile error



Ans: 256, 512, becoz these r different blocks, so declaration allowed


Q30.

main()
{
 int i;
 clrscr();
 for(i=0;i<5;i++)
 {
 printf("%d
", 1L << i);
 }
}
a. 5, 4, 3, 2, 1
b. 0, 1, 2, 3, 4
c. 0, 1, 2, 4, 8
d. 1, 2, 4, 8, 16




Ans: d) L does't make any diff.


Q31.

main()
{
 signed int bit=512, i=5;

for(;i;i--)

 {
 printf("%d
", bit = (bit >> (i - (i -1))));
 }
}

a. 512, 256, 128, 64, 32

b. 256, 128, 64, 32, 16
c. 128, 64, 32, 16, 8
d. 64, 32, 16, 8, 4



Ans: b)


Q32.

main()
{
 signed int bit=512, i=5;

for(;i;i--)

 {
 printf("%d
", bit >> (i - (i -1)));
 }
}

a. 512, 256, 0, 0, 0

b. 256, 256, 0, 0, 0
c. 512, 512, 512, 512, 512
d. 256, 256, 256, 256, 256




Ans: d) bit's value is not changed


Q33.

main()
{
 if (!(1&&0))
 {
 printf("OK I am done.");
 }
 else
 {
printf("OK I am gone.");
 }
}

a. OK I am done

b. OK I am gone
c. compile error
d. none of the above





Ans: a)


Q34

main()
{
 if ((1||0) && (0||1))
 {
 printf("OK I am done.");
 }
 else
 {
printf("OK I am gone.");
 }
}

a. OK I am done

b. OK I am gone
c. compile error
d. none of the above





Ans: a)


Q35

main()
{
 signed int bit=512, mBit;

{

mBit = ~bit;
bit = bit & ~bit ;

printf("%d %d", bit, mBit);

 }
}

a. 0, 0

b. 0, 513
c. 512, 0
d. 0, -513



Ans: d)

What is Multimedia ?

What is Multimedia ?


Multimedia is collection of text,image,audio,video,animation that are displayed to the user via some digital or mean.

Components of multimedia

*Text
*Image
*Audio
*Video
*Animation

Now some description about its component:-



Text:-the use of text , we can see everywhere in out life , to convey something we use text, to show something we use text and many more place we use it.
basically the term text includes alphabets,numeric,special character,etc.

a-z, A-Z, 0-9, !@#$%^&*, etc.


we can see the use text in textbooks , newspaper and many more places.font is also a part of text.but in font we include its property like bold , italic , underline , forecolor etc.


types of fonts:-


serif:-fonts which have tail at the end of each character , known as serif font.it is very useful for hardcopy thats why we see some textbooks containing serif fonts
example:-times new roman,bookman and so on


sans serif:-often used on webpages and does not have tails at the of each character
example:-arial,verdana and so on

Sunday, July 3, 2011

find out number vowel in a string

find out number vowel in a string

#include<stdio.h>
#include<conio.h>
void main()
{
char a[]="array";
int i,v=0,c=0;
for(i=0;a[i]!=NULL;i++)
{
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
{
v++;
}
else
c++;
}
printf("there are %d vowel and %d consonant",v,c);
getch();
}