A array contains dissimilar element how can we count,
and
A array contains dissimilar element how can we store in
another array with out repetition.
Answers were Sorted based on User's Feedback
Answer / abby
array is a homogenous collection of elements, it cannot
contain dissimilar elements.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / beginner in learning c!!
An array can never contain dissimilar elements. You dont
call that derived data type as array!! so the two questions
hav NO ANSWER.. :)
Is This Answer Correct ? | 4 Yes | 2 No |
Hi this code ll work for the second question but first
question i dint understand...
here in souce buff we have 16 nos, in which 1 to 5 repeats
3 times.
but at the end of the program u ll get only nos 1 to 6 as
out in dest buff without duplicate.
Note: Compiler used Visual studio 2005.
#include<stdio.h>
#include<conio.h>
void main()
{
int source[16] = {5,3,4,1,2,1,2,3,4,5,2,3,1,5,4,6};
int dest[6], i, j, count = 0, flag;
int test = 0;
/*Copy the first element*/
dest[0] = source[0];
count++;
for(i = 1; i<= 15; i++)
{
/*Check whether the same element is already
available in the dest buff*/
for(j = 0; j<count; j++)
{
if(dest[j] == source[i])
{
/*Already available*/
flag = 0;
break;
}
else
{
flag = 1;
}
}
if(flag == 1)
{
/*The same element is not available
already - so copy it to the dest buffer*/
dest[count] = source[i];
count++;
}
}
for(i = 0; i<=5; i++)
printf("%d\t",dest[i]);
_getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / prakash
QUESTION WAS NOT DISSIMILAR ,BUT DIFFERENT ELEMENT LIKE,
12344214211LIKE THIS ......
TELL ME THE ANSWER
Is This Answer Correct ? | 0 Yes | 0 No |
write a c program to check weather a particluar bit is set or not?
Write a program to check prime number in c programming?
write a programme to enter some number and find which number is maximum and which number is minimum from enterd numbers.
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What are register variables in c?
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h"
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }
What are multidimensional arrays?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is the difference between malloc() and calloc() function in c language?
write a program for odd numbers?
How is a macro different from a function?