Professional Documents
Culture Documents
New Model Set 3
New Model Set 3
7. Study the given program and answer the given questions. [2]
तल दिइएको प्रोग्राम अध्ययन गरी सोधिएको प्रश्नहरुको उत्तर लेख्नुहोस् ।
DECLARE FUNCTION rev$ (N$) INPUT "Any string"; N$ PRINT rev$ (NS)
END
FUNCTION rev$ (NS)
FOR X = LEN (N$) to 1 STEP-1 AS-MID$ (N$, X, 1) B$ =B$ + A$
NEXT X
rev$ = B$
END FUNCTION
a. List the library function used in the above program.
b. What will be the maximum value of X if the N$ is equal to "Computer?
Group-'C' [4x4=16]
समूह 'ग'
8. Convert / calculate as per the instruction:
• निर्देशन अनुसार बदल्नुहोस् । [4x1=4]
a) (ABC)16 into decimal
b) (501)8 into binaryl
c) (101011+10010) 2
d) (100001-10110)2 x 11₂
9. a)Write a program to input any three numbers and using a SUB procedure
module print the average of those input numbers and print the greatest
number using a function procedure.
क) कु नै पनि तीन नम्बरहरू इनपुट गर्न प्रोग्राम लेख्नुहोस् र SUB procedure मोड्युल प्रयोग गरी ती इनपुट संख्याहरूको
औसत छाप्नुहोस् र function procedure प्रयोग गरेर सबैभन्दा ठू लो संख्या छाप्नुहोस्।
b) Create a sequential data file"Price.dat" to store item name,quantity and Rate also
calculate total amount (total Quantity X Rate).Program should terminate according to
the user's choice.
ख) वस्तुको नाम, मात्रा र दर भण्डारण गर्नको लागि अनुक्रमिक डेटा फाइल "Price.dat" सिर्जना गर्नुहोस् र कु ल रकम (कु ल
मात्रा X दर) पनि गणना गर्नुहोस्। प्रयोगकर्ताको छनोट अनुसार कार्यक्रम समाप्त हुनुपर्छ। [4]
10. Write a C PROGRAM to check whether the given year is leap year or not.
दिइएको वर्ष लीप वर्ष हो वा होइन भनी जाँच्नको लागि C PROGRAM लेख्नुहोस्। [4]
OR अथवा
Write a program in C language to print the following series.