Skip to content

Commit fe0cdbb

Browse files
initial coommit
0 parents  commit fe0cdbb

16 files changed

Lines changed: 141 additions & 0 deletions

ASCIIcode.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <stdio.h>
2+
int main()
3+
{
4+
char c;
5+
printf("Enter a character: ");
6+
7+
// Reads character input from the user
8+
scanf("%c", &c);
9+
10+
// %d displays the integer value of a character
11+
// %c displays the actual character
12+
printf("ASCII value of %c = %d", c, c);
13+
return 0;
14+
}

ASCIIcode.exe

128 KB
Binary file not shown.

add 2no.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include<stdio.h>
2+
main()
3+
{
4+
int a , b, sum;
5+
printf("Enter two numbers:");
6+
scanf("%d%d",&a,&b);
7+
sum=a+b;
8+
printf("%d + %d = %d",a,b,sum);
9+
}

add 2no.exe

128 KB
Binary file not shown.

hello.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include<stdio.h>
2+
void main()
3+
{
4+
printf("hello world!");
5+
6+
}

hello.exe

128 KB
Binary file not shown.

multiply2no.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
int main()
3+
{
4+
double firstNumber, secondNumber, product;
5+
printf("Enter two numbers: ");
6+
7+
// Stores two floating point numbers in variable firstNumber and secondNumber respectively
8+
scanf("%lf %lf", &firstNumber, &secondNumber);
9+
10+
// Performs multiplication and stores the result in variable productOfTwoNumbers
11+
product = firstNumber * secondNumber;
12+
13+
// Result up to 2 decimal point is displayed using %.2lf
14+
printf("Product = %.2lf", product);
15+
16+
return 0;
17+
}

multiply2no.exe

128 KB
Binary file not shown.

nestedfielse.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#include<stdio.h>
2+
void main()
3+
{
4+
char g;
5+
int yos , q , s;
6+
printf("Enter the gender , year of service and qualification(g=0,pg=1)");
7+
scanf("%c %d %d",&g,&yos,&q);
8+
if(g=='m'&&yos>=10&&q==1)
9+
{
10+
s=15000;
11+
}
12+
else if((g=='m'&&yos>=10&&q==0)||(g=='m'&&yos<10&&q==1))
13+
14+
{
15+
s=10000;
16+
}
17+
else if(g=='m'&&yos<10&&q==0)
18+
{
19+
s=7000;
20+
}
21+
else if(g=='f'&&yos>=10&&q==1)
22+
{
23+
s=12000;
24+
}
25+
else if(g=='f'&&yos>=10&&q==0)
26+
{
27+
s=9000;
28+
}
29+
else if(g=='f'&&yos<10&&q==1)
30+
{
31+
s=10000;
32+
}
33+
else if(g=='f'&&yos<10&&q==0)
34+
{
35+
s=6000;
36+
}
37+
printf("\n Salary of Employee = %d", s);
38+
39+
40+
41+
42+
}

nestedfielse.exe

129 KB
Binary file not shown.

0 commit comments

Comments
 (0)