You are here:

C/writting program with C language

Advertisement


Question
-------------------------
Followup To
Question -
-------------------------
Followup To
Question -
-------------------------
Followup To
Question -
-------------------------
Followup To
Question -
-------------------------
Followup To
Question -
writte program that : give two number for example(n and k that n>k).
calculate and print the lower part of collection( the mother collection have n member) that have k member
Answer -
OK. Do it.
Tell me what is the problem you are facing while trying to solve it?
please help me for algorithm of this program and lead e in algorithm
i dont have algorithm for this progaram
Answer -
Your question is not clear (may be because of language).
If you can explain it by considering 2-3 examples, then we can think of a solution.
hi dear
my problem of this program is that i cannot write any algorithm for this program for exampl i donot how can find the lower part of the collection
and i donot have any idia for this program
please helo me in algorirhm of this program
thanks a lot
Answer -
Your original question is not clear to me.
I don't understand the meaning of the sentence: "lower part of the collection".
Also, I don't know what you mean by: "mother collection".

So, if you can take an example, and explain it mathematically, then I can help you to get an algorithm for this.

Hope you understand my suggestion.
hi
i am sorry that cannat tell my mean
an example for this is :mother collectino for example is {1,2,3,4,...,10}
that have n member
and i want creat the small collectin that have k member
for example i want all of smal collecton that have have 2 member
for example {1,2},{3,4},{1,3},{4,5}...
and i dont know the algorithm of this program ,please help me
thanks alot
Answer -
The generalized solution is very complicated.
Try for a specific one.

Put the mother list in an array.
Now, say k=2.
So, you have to have 2 loops.
So, the steps are like this.
1. array = {1, 2, 3, ... , 10}
2. for (i = 1 t0 10)
3. do
4.   for (j = 1 to 10)
5.   do
6.     display (array[i], array[j]);
7.   done
8. done

Hope this will help you.
hi dear
i donot understand your algorithm please explain more for me
thanks a lot

Answer -
Which programming language are you going to use to implement this?
hh dear
i am using C language to write this program
thanks a lot

Answer
If you are really using C programming, then you can very easily understand the algorithm that I have proposed.
In step 1, I am declaring an array and storing some integers.
Step 2 to 8 is a "for loop".
Inside this for loop, there is another "for loop" with steps 4 to 7.
Here you are printing the numbers in the array.

Try to put this into C code, and execute.
And refine it in the way you need it.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.