Check this program
#include<iostream.h>
void main()
{
int count=0;
char name[15];
Type: Posts; User: Mr. AB
Check this program
#include<iostream.h>
void main()
{
int count=0;
char name[15];
I am giving you the logic just try it out:
Take two variables max and min
and find the max number put of these and print it
then again print the second maximum element and so on
Repeat the...
It seems to me that hte logic you have applied to store even and odd positions character is making the error.
Just try this out for storing even and odd characters:
insert
int n1,n2;
...
This is one point that you mentioned
there are other reasons for this also
A program divided into many small functions is easier to maintain,update and debug.
For generating numbers between 40 and 120 use this
(rand()%120)+40
or
you can use this one also
random(81)+40
You have done a very sill mistake my friend
you have writtten
num1=max;
it should be
max=num1;
Same with num2 and num3.
Solution is very simple.
Just try this logic and report me the errors if occured.
LOGIC:
Take a while or do while loop and asks from the user each time whether he wants to enter more codes or...
You have done very silly mistakes
scanf("%d.%d", &c,&d);
no dot b/w %d and %d
it should be like %d%d
There is no as such difference between them.
C c=new C;
now accessing all the variable of a&c
and that of B can be accesed by B->x;(if x is any variable in it);
So, only one instance is created;
I hope you are satisfied if any more...