0% found this document useful (0 votes)
42 views

C Lab Project File

The document contains 11 programming assignments for students. The assignments include programs to print "Hello World", calculate using arithmetic operators, find the maximum of three numbers, check if a number is positive/negative/zero, check if a number is divisible by 5 or 11, check if a number is even or odd, check if a character is an alphabet, check if an alphabet is uppercase or lowercase, check if an alphabet is a vowel or consonant, print the number of days in a month, and calculate salary and gross salary.

Uploaded by

Ashish Jr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

C Lab Project File

The document contains 11 programming assignments for students. The assignments include programs to print "Hello World", calculate using arithmetic operators, find the maximum of three numbers, check if a number is positive/negative/zero, check if a number is divisible by 5 or 11, check if a number is even or odd, check if a character is an alphabet, check if an alphabet is uppercase or lowercase, check if an alphabet is a vowel or consonant, print the number of days in a month, and calculate salary and gross salary.

Uploaded by

Ashish Jr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

S PROJECT NAME DATE TEACHER SIGN

NO.
1 Write a program for print Hello world

2 WAP for implement of calculator with the help of


arithmetical operators

3 WAP to find out the maximum b/w three no

4 WAP to check the no is negative, positive or zero

5 WAP to check whether the no is divisible by 5 or 11

6 WAP to check whether the no is even or odd

7 WAP check whether the character is


alphabet or not

8 WAP to check whether a alphabet is uppercase or


lowercase

9 WAP to input any alphabet and check if it is a vowel or


consonant

10 WAP to input one number and print no of days in that


month

11 WAP to calculate the salary and gross salary for the


given parameter
PROJECT 1:-

WAP for printing hello world:---

#include <stdio.h>

void main()

printf("Hello World");

RESULT:-
PROJECT 2:-

WAP for implement of calculator with the help of arithmetical operators

#include <stdio.h>

void main()

int a,b,sum,mul,divide,sub;

printf("enter first no -");

scanf("%d",&a);

printf("enter second no -");

scanf("%d",&b);

printf("sum,mul,divide,sub of the noumbers");

printf("sum %d \n",a+b );

printf("mul %d",a*b );

printf("divide %d",a/b );

printf("sub %d",a-b );

Result:-

Project 3 :-

WAP to find out the maximum no b/w three no.

#include <stdio.h>
void main()

int a,b,c;

printf("first no a");

scanf("%d",&a);

printf("second no");

scanf("%d",&b);

printf("third no");

scanf("%d",&c);

if (a>b && a>c)

printf("a is the greatest");

else if(b>a && b>c)

printf("b is the greatest");

else

printf("c is the greatest");

Result:-
PROJECT 4 :-

WAP to check the no is positive or negative

#include <stdio.h>

void main()

int a;

printf("the no is-");

scanf("%d",&a);

if(a>0)

printf("a is positive");

else if(a<0)

printf("a is negative");

Result:-
Project 5:-

WAP to check whether the no is divisible by 5 and11

#include <stdio.h>

void main()

int no;

printf("enter the no");

scanf("%d",&no);

if(no/5 && no/11)

printf("the no is divisible by 5 and 11");

else

printf("the no is not divisible by 5 andf 11");

Result:-
QUESTION 6-
WAP TO CHECK WHETHER THE IS EVEN OR ODD

#include <stdio.h>

int main()

int a;

printf("write a no \n");

scanf("%d",&a);

if (a%2==0)

printf("the no is even ");

else

printf("the no is odd");

RESULT-
QUESTION 7-
WAP check whether the character is alphabet or not
#include <stdio.h>

int main()
{
char ch;

printf("write a charecter");
scanf("%c",&ch);
if((ch>=97&&ch<=122) || (ch>=65&&ch<=90))
printf("the character is alphabet ");
else
printf("the character is not a alpahabet");

}
RESULT-
QUESTION 8-

WAP to check whether a alphabet is uppercase or lowercase

#include <stdio.h>

int main()

char ch;

printf("write a alphabet");

scanf("%c",&ch);

if (ch>=65&&ch<=90)

printf("the alphabet is uppercase");

else

printf("the alphabet is lowercase");

Result-
QUESTION 9-

WAP to input any alphabet and check if it is a vowel or consonant

#include <stdio.h>

int main()

char ch;

printf("write a alphabet\n");

scanf("%c",&ch);

if((ch=97,101,105,111,117) ||(ch =65,69,73,79,85))

printf("the alphabet is vowel");

else

printf("the alphabet is consonent" );

Result-
QUESTION 10-

WAP to input one number and print no of days in that month

#include <stdio.h>

int main()

int month;

printf("write the month no 1-12 \n");

scanf("%d",&month);

if(month==1)

printf("january:31 days");

else if(month==2)

printf("february:28/29 days");

else if(month==3)

printf("march:31 days");

else if(month==4)

printf("april:31 days");

else if(month==5)

printf("may:30 days");

else if(month==6)

printf("june:31 days");

else if(month==7)

printf("july:30 days");

else if(month==8)

printf("august:31 days");

else if(month==9)

printf("september:30 days");

else if(month==10)

printf("october:31 days");

else if(month==11)

printf("november:30 days");
else if(month==12)

printf("december:31 days");

RESULT-
QUESTION 11

WAP to calculate the salary and gross salary for the given parameter

#include <stdio.h>

void main()

double sal,gr,hr,pf,da;

printf("enter the salery");

scanf("%lf",&sal);

if(sal>=20000 && sal<30000)

{ hr=(sal*5)/100;

pf=(sal*3)/100;

da=(sal*7)/100;

gr=(sal+hr+da)-pf;

printf("gross salary %lf", gr);

else if(sal>=30000&& sal<50000)

hr=(sal*7)/100;

pf=(sal*5)/100;

da=(sal*9)/100;

gr=(sal+hr+da)-pf;

printf("gross salery %lf", gr);

else if(sal>=50000&& sal<60000)

{hr=(sal*7)/100;

pf=(sal*5)/100;

da=(sal*9)/100;

gr=(sal+hr+da)-pf;

printf("if gross salery %lf" ,gr);


}

RESULT-

You might also like