Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
22 views
C Program Manual 1BCA
Uploaded by
Aushik Hirani
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C program manual 1BCA For Later
Download
Save
Save C program manual 1BCA For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
22 views
C Program Manual 1BCA
Uploaded by
Aushik Hirani
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C program manual 1BCA For Later
Carousel Previous
Carousel Next
Save
Save C program manual 1BCA For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 20
Search
Fullscreen
Problem Solving Lab Using € 1. to read radius of a ci | #include
K #include
f void main() { float r,area, circum; alrscr(); printf("\n Enter radius of a circle :") scant("%ef", 80) area=3.142*r*r cireum=2°3.142"r | printf("\n Area of a circle = fin Ciroumference of a circle = %f \n" area, circum) getch() Output, | Psa SNC NE MSs rey frea of a circ Re RcroN epee sacri tes Nem Ceres 2. to read three numbers and find the biggest of three | #include
void main() (i int n1, n2, n3; clrser(); | printf("Enter three different numbers: ay; | scant("%d%a%a", nt €n2.83) | | if (n1 >= n2.8&n1 >= 03) printf("%éd is the largest number,", n1) if (n2 >= n1 && n2 >= n3) printf("%d is the largest number.", n2); if (n3 >= nt && n3 >= m2) printf("%d is the largest number.", 13); | Government First Grade College, Vijayanagora ee © scanned with OKEN Scanneree Oe Pe mney Seams SE Cea scr Sa oae 3. to check whether the number is prime or not #include
#include
| void main() int num,count=0,i | elrser(); printf("\n Enter a number : ") scanf("%d",&num); for(i=1;i<=num;i++) { | if(numy count++: } if(count==2) | printf("\n 9%d is a Prime number",num); | else | printf("\n %d is not a Prime number’,num): getch(); me! eee ee sc ace _ © scanned with OKEN Scanneryo iSeries Si SaaS Catia 4. to rea palindrome # includestdio.h> # include
void main() int num orgnum int sum=0,rev=0,rem, clrser() print(\n Enter a number :") scant("%d", num): gnum=num; while(num>0) rem=num% 10; sum=sum+rem; rev" 10+rem: print{("\n Sum of digits = 96 printf("\n Reversed number = % i(orgnum==rev) printi("\n Number is a Palindrome’); print{("\n Number is not a Pa getch\); ee eM SEL) SC ae eevee mt ea) Te cue rae tent nea jernment First Grade College, Vijayanagara 'd a number, find the sum of the digits, reverse the number and check it for Page [3 © scanned with OKEN Scanneroe et Sum of digits = 4 coe eC Number is a Palindrome_ -esses 999 and to find the to read numbers from keyboard continuously till the user pr | sum of only positive numbers # include
| #inctude
void main() | int num,sum=0; clrser() do { printf(\n Enter a number :") scanf("%d", &num); if(num > 0 &8& num! 99) sum = sum + num: print("in Sum = Yd”, sum); while(num!=999), printf("\n You have pressed STOP"); getch() res nt Fit sais College, Vijayanagara Page Ta © scanned with OKEN Scanner. to read per else-if ladder | Program to Demonstration (/ Pereontage > 90% BO% ~ 90% 70% = 79%, 60% ~ 69% 50% - $9% 38% = 49% wemtage of marks and to display appropri Ml percentage of marks andl to oF Colye-if) ladder Grade Exemplary Outstanding Division with Distinet rst Division Second Division Pass class Reappear | # includesstdio.n> | incudesconio | void main’ { | float per; clrser() printf('\n Enter Percentage : ") scanf("96"",&per); (per > 90.0) printf("\n Grade = EXEMPLARY"); else if(per >=80.0 && per < 90.0) | _ printf(\n Grade = OUTSTANDING") else if(per >=70.0 88 per < 80.0) else if(per >=60.0 && per < 70.0) printf("1n Grade = FIRST DIVISION") else if(per >=50.0 &8 per < 60.0) | printf("\n Grade = SECOND DIVISION’) | else if(per >=35.0 && per < 50.0) printf("Wn Grade = PASS CLASS"). else printf("\n Grade = FAILS : RE-APPEAR’) getch() } Qutput Bec con ron Government First Grade College, Vijayanagara print{("\n Grade = FIRST DIVISION WITH DISTINCTION") ene ¢ message (Demonstration of display appropriate message Page [5 © scanned with OKEN Scanner. to find the roots of quadrat cy Grade = OUTSTANDING Cen eer) SUSUR TMS Le Paced CSS Una) oo aes) Grade = SECOND DIVISION ery Grade = PASS CLASS Pree eet Grade = FAILS : RE-APPI equation #include
#include
void main() { float a,c float d,roott 0012 celrscr(); print("Enter db and of quadratic equation: *) scant "tr Ba, 8b,8c) d=b*b-4*a'e if(d < 0) { printf("Two distinct complex roots exists: ") 3% f-i(2"8) sart-a)}2"2)) printf" printf, %.31%+.3M"-b/(2*a),-sqrt(-d)(2"a)); © Scanned with OKEN Scanner) Problem Solving Lab Using ¢ else it(d==o, ( TOOtt = -b /(2* a) Prnt(Two equal and realroot xi { Ott = (-b + sart(ay) /(2* a FOOK2 = (-b - sqrt(d)) / (2° a Brot cstinet and real rots exists: 6.31, %.9° root soo getchi) Queput: f quadratic equat x roots Cee Fy 8. to read marks scored by n students and find the ay ‘erage of marks (Demonstration of single dimensional array) # include
# include
void main() It ni float marks[10), tot_mark: O,avg_marks=( clrsor(): | printf(\n Enter students count(n) :") | scanf("%d",&n) | for(i=t : printf("\n Enter mark scored by %d student : "+1); scanf("%f",amarksil); ji
# include
void main() i int a[20},n.i,j.ele: clrser() printf("\n Enter array limit(n) scanf("%d",8n); for(i=0;l
# include
void main() int a[10](10}, b{40)[10}, o{10}(10}, 4(10](10}; inti | Government First Grade College, Vijayanagara “rage © Scanned with OKEN ScannerProblem Solving clrsert) Brinn Enter order of aquare mattix(n) :*); Sscant(“P0",8n), Drint("\n Enter A matrix eloments\n" for(ieO;kenie+) { fori-0;
# include
void main() =1,NXT; int FC clrser() printf("1n Enter series limit(n) scanf{"%d",&n); printf(" FIBONACCI SERIES * print{("%d \t %d"\F,S); for(i=3ji<=nii++) x NXT=F+S) Printf("t %d", NXT); F=S; S = NXT, getch(); Pag © Scanned with OKEN Scanner- Problem Solvins 7. co find the length of vk a string w Ms Without using built in function # include
# include
void main() intlen=0, char *str: | ctrsex) print Enter asrng:*) ‘scanf("%s" str); whie(st=%0) lens ) | brintin Length of sting = %d"Ien) | getcno) ETS | ee st ea) 14. to demonstrate string functions # include
#include
# includecstring.h> | void main() 3 | { | char ‘str1="Bangalore" clrscr(); | printf("n String 1 = %s String 2= %s\n"strst2) | | char “str2="Universit print("\n 1. Length of %s = %d".str1 strien(strt)); | printf("n 2. String copy in str2 = %s",strepy(str2,"CITY")), printf("1n 3. Concatenation = %s", streat(str4,str2)); printi("in 4. Compare str1 & str2 %d",stremp(str1,"bangalore")); | printf("in 6. String in upper case = %s",strupr(str1));, | printf("n 5. String in lower case = %s",striwr(str1)); | | printf("in 7. Substring search = %s" strehr(str1,'L); printf("\n 8. Duplicate string = %s" strdup(str1)); ‘Government First Grade College, Vijayanagara Page [13 © scanned with OKEN ScannerJerse = %s",strrev(strt)) print{("\n 9. String re’ fe printf("\n 10. Set all character to # = %s" strset(str1,# getch() ) Output. Se Ma Tm a ee ee ae) String copy in str2 = CITY Concatenation = BangaloreClTY + Compare stri & str2 -32 Su OMe meres a eee ren oh een at : Piven Rater) SSC ec esti 15. to read, display and add two m x n matrices using functions #includestdio.h> Void muttiply(int matt[12}{12} int mat2{12}(12)int it nt void main() int mat4[12](12],mat2[12][12} intijkim.ngp: clser(); Printf("Enter the number of rows and columns for 1st matrix\n’’ scanf("%d%d" &m,&n); printf("Enter the elements of the matrix\n") for(i=0;i
#include
# include
void main() { : ; t char str100} oh; int acount=0, deount=0, veount=0, ccount=0, scount=0, spcount=0 i=0; | clrser(); | printf("\n Enter a string :"); | gets(str); | white str a college, Vi ae rage TIE Government First Grade College, Vijayanagara © Scanned with OKEN Scannerelse iffisdigit(stt else iflisspace( acount++ ch=tolower(str() case 'o case 'U': veount++ dcount++ print getch( n No. “Government First Grade College, Vijayanagara 0. of Vowels = %d 0. of Spaces sti) of Alphabe "acount of Consonants = 2 count) Digits = %d" dcount of Special symbols = %d", spcount) ee ecco d Peer a Problem Solving Lab Using C Page 117 a © Scanned with OKEN Scanner17. to Swap Two Numbers using Pointers # include
# include
void main() int 1,n2,*ptr1 ,*ptr2,temp: clrser() printf("\n Enter two numb scant(""%d %d",8n1, &n2) printf("\n Before swappin | ptri=ant liswapping temp="ptr1 *ptrt="ptr2; *ptr2=temp: printf("\n After swapping n1 = %d_n2 = %din’,n1,n2); | getch() Govern’ iment First Grade College, Vijayanagara © Scanned with OKEN Scannerfi inowde
Problem Solving Lab Using C o demonstrate student structure to re ‘ad & display records of n students (54h include
struct STUDENT { int regno; char name(50} | char grade; | 8cA(s0); | void maing) r ) intr | clrscr() brintf("\n Enter student countin) :") | scanf("%d",&n) for(i=Qiicni++) { | printf('n Enter %d student(regno,name,grade) :" i+); | seanf(Y6d %s He", BBCAl].regno BCA name, BBCA] grade) printf("in REGNO \t STUDENT NAME \t GRADE") for printf("\1n %¢ \t %s \t 9c", BCALi}.regno, BCA name, BCAIi].grade) getch() Mee can Pee ec nr cc) Pee Toners Len aa | a f | ery Peo 1 ar f r a ry Toe cae ynagara Government First Grade College, Vlayanaga ov © Scanned with OKEN ScannerProblem Solving Lat between structure & union. 19. to demonstrate the difference # inolude
{ t bot intempid; 12 bytes 4 char name{50}; // 50 bytes nae loat salary; 4 bytes (Total =2 + 50 + 4 = 56) u } union EMP2 int empid; 1/2 byt . * 114 bytes (highest = 50 bytes) void main() ¢ ( £ clrser) F : { Print{("In Size of Structure EMP1 = %d" sizeof(struct EMP1)) printf("1n Size of Union EMP2 = %d",sizeof(union EMP2) getchi); age escieame ll © Scanned with OKEN Scanner Goverr rnment First Grade College, Vijayanagara
You might also like
DocScan 11 08 2022
PDF
No ratings yet
DocScan 11 08 2022
17 pages
C-Lab-manual
PDF
No ratings yet
C-Lab-manual
16 pages
PC Lab Manual
PDF
No ratings yet
PC Lab Manual
23 pages
pst
PDF
No ratings yet
pst
17 pages
Cprogram Final Lab Manual
PDF
No ratings yet
Cprogram Final Lab Manual
26 pages
C Program lab Manual
PDF
No ratings yet
C Program lab Manual
24 pages
Write A Program To Print Diamond Inscribed Inside Rectangle: Solution
PDF
No ratings yet
Write A Program To Print Diamond Inscribed Inside Rectangle: Solution
28 pages
C Lab Manual
PDF
No ratings yet
C Lab Manual
16 pages
PST Progerams
PDF
No ratings yet
PST Progerams
19 pages
Let Us C Solutions PDF
PDF
No ratings yet
Let Us C Solutions PDF
188 pages
C Programming Lab Manual
PDF
No ratings yet
C Programming Lab Manual
26 pages
Lab Exercise
PDF
No ratings yet
Lab Exercise
49 pages
PST Programs
PDF
No ratings yet
PST Programs
14 pages
Electronic Lab C Program
PDF
No ratings yet
Electronic Lab C Program
11 pages
C Programming Lab Manual
PDF
No ratings yet
C Programming Lab Manual
27 pages
Program bài tập
PDF
No ratings yet
Program bài tập
7 pages
C Language Programs
PDF
No ratings yet
C Language Programs
46 pages
Programming Assignment
PDF
No ratings yet
Programming Assignment
22 pages
Gautam
PDF
No ratings yet
Gautam
33 pages
Practical Questions
PDF
No ratings yet
Practical Questions
16 pages
PDS Assignment 1
PDF
No ratings yet
PDS Assignment 1
5 pages
Board Question C Program Solve
PDF
No ratings yet
Board Question C Program Solve
33 pages
c Programming Lab
PDF
No ratings yet
c Programming Lab
32 pages
Lab 0-1
PDF
No ratings yet
Lab 0-1
15 pages
Advanced C-Programming: N .Manoj Reddy
PDF
No ratings yet
Advanced C-Programming: N .Manoj Reddy
17 pages
Practical C
PDF
No ratings yet
Practical C
28 pages
C Practical Work
PDF
No ratings yet
C Practical Work
50 pages
Assignment 1 of C Language
PDF
No ratings yet
Assignment 1 of C Language
17 pages
Sample PGM
PDF
No ratings yet
Sample PGM
8 pages
C Programming - Lab-A
PDF
No ratings yet
C Programming - Lab-A
14 pages
C Programs
PDF
No ratings yet
C Programs
45 pages
BSc Final_C-Record
PDF
No ratings yet
BSc Final_C-Record
34 pages
C Language Notes-2
PDF
No ratings yet
C Language Notes-2
40 pages
C Lab Report
PDF
No ratings yet
C Lab Report
31 pages
C Programming Assignment PDF
PDF
0% (1)
C Programming Assignment PDF
12 pages
C Programs 1. Odd or Even
PDF
No ratings yet
C Programs 1. Odd or Even
4 pages
C Chapter 04
PDF
No ratings yet
C Chapter 04
17 pages
#Include #Include #Include Void Main (
PDF
No ratings yet
#Include #Include #Include Void Main (
47 pages
C Programme For SP - 25 Points
PDF
No ratings yet
C Programme For SP - 25 Points
20 pages
Assignment 1 mahbub sir v2
PDF
No ratings yet
Assignment 1 mahbub sir v2
52 pages
C Lab Questions
PDF
100% (9)
C Lab Questions
20 pages
Assignment C Programming
PDF
No ratings yet
Assignment C Programming
10 pages
Operating System Lab (K)
PDF
No ratings yet
Operating System Lab (K)
67 pages
12.1-Comparison of Two Numbers 12.2-Biggest of Three Numbers Are Not Dere in Dis Get It From Some One
PDF
No ratings yet
12.1-Comparison of Two Numbers 12.2-Biggest of Three Numbers Are Not Dere in Dis Get It From Some One
24 pages
PST Manual
PDF
No ratings yet
PST Manual
16 pages
PL1 All Codes by Sadat
PDF
No ratings yet
PL1 All Codes by Sadat
63 pages
A Personal Collection of CODE (C++) Turbo++ Shamim Mahmud Nazmul Hosen
PDF
No ratings yet
A Personal Collection of CODE (C++) Turbo++ Shamim Mahmud Nazmul Hosen
30 pages
Lab Exercise For C Programming
PDF
100% (1)
Lab Exercise For C Programming
51 pages
C Lab Programs
PDF
No ratings yet
C Lab Programs
26 pages
Nitin Negi
PDF
No ratings yet
Nitin Negi
33 pages
Codoo - Qqs C: Lguestion 5.b.c X HP/Documentsquestion
PDF
No ratings yet
Codoo - Qqs C: Lguestion 5.b.c X HP/Documentsquestion
7 pages
Digital Assignment-1: Advanced C Programming
PDF
No ratings yet
Digital Assignment-1: Advanced C Programming
17 pages
CP Lab Programs Weekwise
PDF
No ratings yet
CP Lab Programs Weekwise
12 pages
Submitted To Submitted by
PDF
No ratings yet
Submitted To Submitted by
34 pages
Karan
PDF
No ratings yet
Karan
36 pages