Professional Documents
Culture Documents
SUBMITTED BY SUBMITTED TO
NAME: Shahil Ahamad Yuba Raj Khanal
CLASS: 11 ‘A’
ROLL NO: 35
--------
Signature
First and foremost, I would like to thank my computer teacher for guiding and
supporting me throughout the project. Her invaluable suggestions and feedback
helped me to improve my work and complete the project within the given
deadline.
I would also like to thank my parents for their constant encouragement and
support during this project. Their motivation and belief in me have been a
constant source of inspiration.
Lastly, I would like to thank the internet, various books, and other resources that
were instrumental in providing me with the necessary information and knowledge
required for this project.
Once again, thank you to everyone who has contributed to the successful
completion of this project.
Email : shahilahamad08@gmail.com
Address : Sukhanagar,Butwal-08,Rupandehil
Mobile : 9748703587
Gender : Male
Religion : Islam
Qualification :
Mark-Sheet
Name English Nepali Math Science Total Percent Result Division
Q1. Write an algorithm and draw flowchart to input and height of the
cylinder & height of the cylinder and display the volume?
Algorithm :
Step 1: Start
Step 2: Input radius as ‘r’ and height as ‘h’
Step 3: Calculate volume=(22/7)*r*r*h
Step 4: Display Volume
Step 5: End
Flowchart :
Start
Read r , h
V=(22/7)*r*r*h
Display V
End
Q2. Write an algorithm & flowchart to input length , breadth & height of a box
and display the volume?
Algorithm :
Step 1: Start
Step 2: Input l , b & h
Step 3: Calculate V = l*b*h
Step 4: Display V
Step 5: End
Flowchart :
• C-Looping :
The computer can perform a set of instructions repeatedly . This involves repeating some
portion of a program either for a specified number of times or till a given condition is satisfied
number of times or till a given condition is satisfied . This repetitive operation is done by a loop
Control statement.
for loop first Initializes, then condition check, then executes the body and at last, the update is
done.
while loop first Initializes, then condition checks, and then executes the body, and updating can
be inside the body.
do-while do-while first executes the body and then the condition check is done.
loop
For loop :
Example
#include<stdio.h>
int main(){
int i ;
for(i=10 ; i>=0 ; i--){
printf("Hello World");
}
return 0;
}
While Loop :
Example:
#include<stdio.h>
int main(){
int i=0 ;
while (i<=10){
printf("Hello World");
i++;
}
return 0;
}
Do While Loop :
Example
#include<stdio.h>
#include<conio.h>
int main(){
int i=0 ;
do{
printf("Hello World");
i++;
}while(i<=10);
getch();
}
C-Array :
Q1.Write a C program to ask ten numbers from the user and
display them using array?
#include<stdio.h>
#include<conio.h>
int main()
{
int i , a[10];
for(i=0 ; i<10 ; i++){
printf("Enter the numbber\t");
scanf("%d",&a[i]);
}
printf("The nnumbers you entered are: \t");
for(i=0 ; i<10 ; i++){
printf("\n%d",a[i]);
}
getch();
}
Q2.Write a C program to copy source string to
destination string using string array?
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
char str1[30] , str2[30];
printf("Enter string to copy :\t");
scanf("%S",str1);
strcpy(str2,str1);
printf("The copied string is : %S",str2);
getch();
}