Write a program that finds the minimum total number of
shelves, including the initial one required for this loading
process.



Write a program that finds the minimum total number of shelves, including the initial one required ..

Answer / raveathul farzaana.m.y

#include<stdio.h>
#include<conio.h>
void main()
{
char packet[25];
int
n,counta=0,countb=0,countc=0,countd=0,counte=0,countf=0,countg=0,counth=0,counti=0,countj=0,countk=0,countl=0,countm=0,countn=0,counto=0,countp=0,countq=0,countr=0,counts=0,countt=0,countu=0,countv=0,countw=0,countx=0,county=0,countz=0;
int shelves=0;
printf("Enter the number of packets:");
scanf("%d",&n);
printf("Enter the packets one by one:");

for(i=0;i<n;i++)
{
scanf("%c",&packet[i]);
}
for(i=0;i<n;i++)
{
if(a[i]==A)
counta++;
if(a[i]==B)
countb++;
if(a[i]==C)
countc++;
if(a[i]==D)
countd++;
if(a[i]==E)
counte++;
else if(a[i]==F)
if(a[i]==G)
countg++;
countif(a[i]==H)
counth++;
if(a[i]==I)
counti++;
if(a[i]==J)
countj++;
if(a[i]==K)
countk++;
if(a[i]==L)
countl++;
if(a[i]==M)
countm++;
if(a[i]==N)
countn++;
if(a[i]==O)
counto++;
if(a[i]==P)
countp++;
if(a[i]==Q)
countq++;
if(a[i]==R)
countr++;
if(a[i]==S)
counts++;
if(a[i]==T)
countt++;
if(a[i]==U)
countu++;
if(a[i]==V)
countv++;
if(a[i]==W)
countw++;
if(a[i]==X)
countx++;
if(a[i]==Y)
county++;
if(a[i]==Z)
countz++;
}
if(n>0)
{
if(counta>0)
shelves++;
if(countb>0)
shelves++;
if(countc>0)
shelves++;
if(countd>0)
shelves++;
if(counte>0)
shelves++;
if(countf>0)
shelves++;
if(countg>0)
shelves++;
if(counth>0)
shelves++;
if(counti>0)
shelves++;
if(countj>0)
shelves++;
if(countk>0)
shelves++;
if(countl>0)
shelves++;
if(countm>0)
shelves++;
if(countn>0)
shelves++;
if(counto>0)
shelves++;
if(countp>0)
shelves++;
if(countq>0)
shelves++;
if(countr>0)
shelves++;
if(counts>0)
shelves++;
if(countt>0)
shelves++;
if(countu>0)
shelves++;
if(countv>0)
shelves++;
if(countw>0)
shelves++;
if(countx>0)
shelves++;
if(county>0)
shelves++;
if(countz>0)
shelves++;
printf(shelves)
}
else
{
printf("-1");





cont... after this

Is This Answer Correct ?    17 Yes 3 No

Post New Answer

More Engineering AllOther Interview Questions

How many VLANs are supported on a single switch

0 Answers  


An inversion is an array of numbers is any pair (i,j) such that i<j and A[i]>A[j]. What is the average number of inversions in an array of n ? distinct numbers?

2 Answers   Infosys,


what is mean by tranducer

0 Answers  


i want to know details about SBI bank exam and date when to apply and what is the eligibility and the model papers related to it and various post available for Engineering in Information Technology.

0 Answers  


Modal vs Modaless in VB??

0 Answers  






What is the difference between wimdow Nt, 2000 amd 2003 server ?

1 Answers  


plz explain abt refrigeration r22 bitzer comprassors trouble shooting and maintenance

0 Answers  


What is VAT Account determination ? and how we can map in SAP ?

0 Answers   TCS,


how to count 4 column with two "and" condition in oracle? e.g task_type and cust_type and service_type are 3 column and we hv to count where task_type="new"and cust_type="jdp" and resulting column name will be new cust with jdp..and also we hv to count where task_type="new"and service_type="fs" resulting column name will be new cust with fs..

0 Answers  


any one can help me to know the top mnc companies and their working platforms?i mean java,php...

0 Answers  


what are the things to be mentioned for the question "Tell me about yourself??

6 Answers   CTS, Patni,


minimum percentage in B.E in(INFORMATION TECHNOLOGY) to be eligible for IES exam qualification and also for reserved categories.are IT engineers are eligible for giving IES exams? please reply soon.

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)