0% found this document useful (0 votes)
16 views1 page

Hands On

The document appears to be a complex and fragmented C programming code that includes various initialization, input/output operations, and control structures. It involves user interactions to input product prices, quantities, and other variables, while also performing calculations and checks on the data. Overall, it seems to be a draft or incomplete version of a program designed for managing product purchases and related computations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Hands On

The document appears to be a complex and fragmented C programming code that includes various initialization, input/output operations, and control structures. It involves user interactions to input product prices, quantities, and other variables, while also performing calculations and checks on the data. Overall, it seems to be a draft or incomplete version of a program designed for managing product purchases and related computations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

START

START // Online C compiler to run C program online


#include <stdio.h>

INITIALIZE product[5]= INITIALIZE


int main() {
{"mobile","laptop","speakers","power // Write C code here
you[3],frnd[3],price[3],total_you=0,
int arr[10];
bank","usb"}, seller[3]= total_frnd=0
for(int i=0;i<10;i++){
{"Flipkart","Amazon","Snapdeal"}, value[5] scanf("%d",&arr[i]);
[3],val,pro,sell PRINT Enter the no of kgs of }
apples, oranges and grapes printf("The number you entered is ");
bought by you for(int i=0;i<10;i++){
printf("%d",arr[i]);
START
START }
FOR i=0 to i<5 DO }
NO

FOR i=0 to i<3 DO


INITIALIZE a[10],b[10],n,count=0
NO INITIALIZE arr[10][3],n,sum=0,val
YES DISPLAY Enter the values of
START START
START first array..
YES
NO DISPLAY Enter the number of START
FOR i=0 to i<3 DO DISPLAY Enter the number of START START
READ you[i] players START START
products
INITIALIZE arr[50],n,max=0 INITIALIZE arr[10],n,sum=0,avg INITIALIZE START START
FOR i in 0 to START
n1,n2,id1[],id2[],id1status=0,id2status=0 n1-1 DO START
NO START START START
YES INITIALIZE arr[10], i=0 START
READ n START INITIALIZE
NO READ n YES INITIALIZE variables
DISPLAY Enter the number of DISPLAY Enter the number of START INITIALIZE num,val,count,number,i=0 remainder,reverse=0,number,num
READ value[i][j] CHECK IF you[i]<0 DISPLAY Enter size of first count=0,sum=0,number INITIALIZE number=1,sum=0
students projects INITIALIZE floor,n1,n2,n3 result
READ id1[i] INITIALIZE age,income INITIALIZE number,even=0,odd=0,digit
and second array.. INITIALIZE number=0,N=17
DISPLAY Enter the score of INITIALIZE t1=0,t2=1,t3,i=3
INITIALIZE number,count=0,id INITIALIZE num,val,count,number,i=0
DISPLAY Enter the price for n INITIALIZE count,number=2
Group A NO INITIALISE number,num,sum=0,val
YES products by 3 sellers READ number
READ n READ n NO IF id1[i] <= 0 DISPLAY Enter the values of REPEAT FOR i<10 INITIALIZE n,fact=1,i=1 READ number
NO READ n1, n2 READ num
CHECK IF value[i][j] THEN second array.. READ age,income,tax
<0 PRINT Enter the no of kgs of READ floor,n1,n2,n3
apple, orange and grapes bought NO
YES DISPLAY t1,t2 REPEAT DO WHILE ! REPEAT WHILE
YES READ id,number READ num NO DISPLAY sum READ number
by your friend DISPLAY N
DISPLAY Enter the project (number>=0 and number!=0
FOR i=0 to i<n DO DISPLAY Enter their marks READ number NO
FOR i=0 to i<n DO score SET id1status=1 REPEAT FOR number<=20)
NO NO YES READ n INITIATE i=a STOP ASSIGN num=number
YES NO IF n1<=0 || n2<=0 READ each element as arr[i] number<=100
THEN CHECK IF DISPLAY Age is less NO
REPEAT WHILE
IF id1status==0 && NO age<20 READ number
sum<=100 YES
YES id2status==0 YES STOP
FOR i=0 to i<3 DO YES DISPLAY invalid id STOP
YES THEN CHECK IF NO REPEAT FOR i<=9 INITIATE num = number
NO NO DISPLAY result REPEAT WHILE NO YES
NO floor<0 DISPLAY count DO YES REPEAT WHILE CHECK IF
READ a[i] FOR i=0 to i<n DO NO NO DISPLAY Number is Lucky
NO FOR i=0 to i<n DO INCREMENT i value as i++ YES number>0 NO REPEAT FOR READ number
PRINT "Invalid array NO number!=0 even==odd
FOR i=0 to i<5 DO NO YES NO REPEAT WHILE i<=b STOP READ number
YES size" STOP STOP t1+t2<100 DO NO YES
FOR j=0 to j<3 DO YES REPEAT FOR i<=n DISPLAY fact INITIATE count=0,i=2
CHECK ELSE IF DO REPEAT WHILE CHECK IF
RETURN YES DISPLAY PALLINDROME
DISPLAY Enter the score of YES age>100 OR age<0 DISPLAY Invalid input COMPUTE sum = sum+number YES number!=0 num==reverse
READ frnd[i] YES NO
YES Group B OR income<=0 STOP NO
FOR i in 0 to n1-1 DISPLAY STATEMENT The NO YES YES
REPEAT WHILE PRINT num is an Armstrong YES
YES READ arr[i] number you entered is YES CHECK IF val==num STOP
READ arr[i] number !=0 DO number
YES READ number INITIALIZE num,val,count,number,i=0 NO
SET val=100000 DISPLAY Enter the values of NO YES CHECK IF
STOP NO COMPUTE digit=number%10 DISPLAY Number is Not Lucky
READ arr[i][j] YES CALCULATE count = count+1 NO CHECK IF number>0
second array.. COMPUTE t3=t1+t2
NO YES REPEAT FOR NO DISPLAY Enter right value.. (number>=0 &&
CHECK IF frnd[i]<0 YES YES CHECK IF COMPUTE fact = fact *i YES YES
NO CHECK IF count == NO CHECK ELSE IF CHECK IF ASSIGN result=n1 CHECK IF NO number<=20)
FOR i=0 to i<n DO COMPUTE INITIALIZE i=0 CALCULATE tax=income n1>floor i<=sqrt(number)
PRINT Teams are not compatible SET flag=0 age>=20 and income<=2 increment i ASSIGN val = i
n THEN sum=sum+arr[i] i%11==0
NO increment count CALCULATE emainder=number%10 DISPLAY NOT A PALLINDROME STOP
age<60 50000 YES
CHECK IF NO COMPUTE val=number%10
YES ASSIGN max = max NO REPEAT WHILE DISPLAY frequency of each PRINT num is not an Armstrong COMPUTE reverse=reverse*10+remainder
arr[i]>max THEN IF id1status ==0 READ number increment i=i+1 STOP
FOR i=0 to i<3 DO number!=0 digit CALCULATE sum+=val*val*val number ASSIGN number/=10
YES
YES YES THEN NO NO DISPLAY t3 YES
NO NO NO COMPUTE number /=10 CHECK IF
YES COMPUTE sum+=number COMPUTE even+=digit
PRINT Enter the price of apple, NO NO DISPLAY val digit%2 == 0
orange and grapes per kg COMPUTE avg=sum/n FOR j in 0 to n2-1 REPEAT FOR i<10 YES
PRINT Teams are compatible READ b[i] FOR i=0 to i<n DO YES YES CHECK IF YES COMPUTE N+=number
YES YES CHECK IF
NO income>250000 and CALCULATE tax=income*0.1 result>n2 and ASSIGN result=n2 CHECK IF
income<=500000 n2>n CALCULATE val=number%10 ASSIGN t1=t2 and t2=t3 number%i==0 NO
ASSIGN max=arr[i] YES
NO YES
FOR i in 0 to n2-1
YES YES COMPUTE i=i+10
CHECK IF NO DO
ASSIGN val = val STOP NO CHECK IF avg>80 DISPLAY Assign more NO COMPUTE odd+=digit
val<value[i][j] FOR i=0 to i<3 DO CHECK IF a[i]>b[i] NO
THEN assignments IF id1[i]==id2[j] DISPLAY each element YES
NO SET val=1000 NO BREAK
YES THEN
DISPLAY Maximum mark AS CHECK IF YES CHECK IF var == i
NO income>500000 && CALCULATE tax=income*0.2 increment count=count+1
max
YES YES READ id2[i]
YES YES income<=1000000 increment i=i+1
CHECK IF YES
ASSIGN val = val=value[i][j], YES
INCREMENT i value as i++ result >n3 and ASSIGN result=n3 STOP CALCULATE number/=10
pro=i, sell=j READ price[i] SET count = count + 1 DISPLAY Allocate a real NO
increment flag++ n3>n
project
FOR j=0 to j<3 DO STOP COMPUTE number = number/10
NO NO START
IF id2[i] <= 0 CALCULATE tax=income*0.3 BREAK
THEN
STOP
PRINT Buy product[pro] from
CHECK IF price[i] NO COMPUTE total_you+=you[i]*price[i], YES STOP BREAK YES
seller[sell] STOP CHECK ELSE IF START
<0 total_frnd+=frnd[i]*price[i] YES ASSIGN result=n2
n2>floor
INITIALIZE sum=0,price[10]
YES YES
CHECK IF val<arr[i] SET id2status=1 CHECK IF age>=60 YES CHECK IF increment i=i+1
YES ASSIGN val=val CALCULATE tax=income
[j] THEN and age<=80 income<=300000
NO IF count==0
NO INITIALIZE amount
THEN
PRINT You need to pay DISPLAY invalid id
NO NO CHECK IF YES
Rs.total_you and your friend STOP YES NO NO YES
needs to pay Rs.total_frnd. result >n3 and ASSIGN result=n3 REPEAT FOR i=0 to CHECK IF
DISPLAY amount as sum CHECK IF
n3>n 9 sum<=1000
ASSIGN val = arr[i][j] PRINT id1[i] count==0
CHECK IF YES
BREAK READ amount
income>300000 and CALCULATE tax=income*0.1 YES NO
income<=500000 YES

STOP READ price[i] DISPLAY Out of Budget STOP


COMPUTE sum=sum+val
NO YES
OR ELSE IF DISPLAY number
ASSIGN result=n3
n3>floor YES
CHECK IF CHECK IF amount<0 DISPLAY Cannot Generate Bill
INITIALIZE sum=0,price[10]
income>500000 YES
DISPLAY sum && CALCULATE tax=income*0.2
income<=100000 increment number=number+1
NO
0
NO

NO
STOP

CALCULATE tax=income*0.3 YES


CHECK ELSE IF DISPLAY GIVE 5% discount AS
amount<=2500 amount - amount*0.05

DISPLAY result STOP


YES
CHECK IF age>80 YES CHECK IF
NO
and age<=100 income>500000 CALCULATE tax=income

NO
NO CHECK ELSE IF YES
DISPLAY GIVE 5% discount AS
amount<5000 and
amount - amount*0.05
amount>2500
CHECK IF YES
income>300000 and CALCULATE tax=income*0.2
income<=500000
NO

NO DISPLAY GIVE 10% discount AS


amount - amount*0.1

CALCULATE tax=income*0.3

STOP
DISPLAY tax

STOP

You might also like