Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

C language basic programs with logic

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
29-12-2024
Written in
2023/2024

C language programs with logic which helps with basic logic implementation which is used in bsc or mcs examination of graduation

Institution
Course

Content preview

Program Name Logic / Formula
1] The Range of data types: 1] Char=CHAR_MIN,CHAR_MAX

2] Int=INT_MIN,INT_MAX

3] Float=FLT_MIN,FLT_MAX



2] The size of data types: 1] Char=sizeof(char)

2] Int=sizeof(int)

3] Float=sizeof(float)

4] Double=sizeof(Double)



3] Operators:



*Arithmatic operators programms: (a+b),(a-b),(a*b),(a/b),(a%b)

*Relational operators programms: (a<b),(a<=b),(a>b),(a>=b),(a==b),(a!=b)

*Logical operators programms: (a&&b),(a||b),(a!b)

*Conditional operators programms: (a>=b)?printf("a is greater"):printf("b is greater");

*Assignment operators programms: (a=b)

*Bitwise operators programms: (a>>1),(a<<1)

*Increment/Decrement operators programms: (a++,++a),(a--,--a)

*special operator: (a,b)



4] Area of circle: (3.14*r*r)

5] Area of Rectangle: (Length*Breadth)

Perimeter of Rectangle: 2(l+b)

6] Area of Square: (side*side)

7] Area of Triangle: 0.5*base*Height

, Program Name Logic / Formula
8]Swapping of 2 numbers with using 3rd variable: c=a
a=b
b=c



9]Swapping of 2 numbers without using 3rd variable: a=a+b
b=a-b
a=a-b



10] sum and Average programm: sum=a+b+c

Average=sum/3



11] Simple Intrest: p*n*r/100



12] Reverse of any numbers: d1=no%10

no=no/10

Rev=d1*100+d2*10+d3



13] Sum of Digits using d1,d2,d3: d1=no%10

no=no/10

Sum=d1+d2+d3



14] person is Eligible or not for voting: if (Age>=18)



15] To check number is positive or Negative: if (no>0)



16] To check Student is Pass or Not : if (S1>=30 && S2>=30&& S3>=30 && S4>=30 && S5>=30)



17] To check Password Correct or Wrong: if (password==**)



18] To check Number is natural or not: if (no>=1)

Written for

Course

Document information

Uploaded on
December 29, 2024
Number of pages
6
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.79
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
shwetaawalwar

Get to know the seller

Seller avatar
shwetaawalwar College of computer science and information technology, latur
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
2
Last sold
-
Notes Section

Notes of 11th and 12th grade, question paper of 11th and 12th, privious year neet papers, graduation notes in computer science subjects, question paper of graduation, assignments

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions