alingment :
DOTS REPRESENT SPACES
DESIRED OUTPUT
Item................................................PriceBurger..............................................100
pizza.............................................. ..50
patty................................................ 25
coke.............................................. ..10
OUTPUT BY PROG.
Item Price
Burger 100
pizza 50
patty 25
coca-cola 10
DISPLAY CODE
for(k=0; k<no; k++)
{
cout<<endl;
for(m=0; arr[k][m]!='\0'; m++)
{
cout<<arr[k][m];
}
cout<<" "<<price[k];
}
Interger array input without asking for number of terms
/* Name- inp_arr
parameters- none
output - none ()*/
#include<iostream.h>
#include<conio.h>
void inp_array ()
{
int a[100],i;
cout<<"Enter the integer array and press 0011 after the last therm"<<endl;
for(i=0;a[i]!=0011;i++)
{
cin>>a[i];
j++;
}
return;
}
j which is the counter for the number for terms assumes -36 values no matter what the input.
Also is it possible to output a array ??