0% found this document useful (0 votes)
2 views4 pages

C Programming Assignment Tasks

The document contains code for 3 C programs: 1) A program to check if a character is a vowel or consonant. 2) A program to convert specified days into years, weeks and remaining days. 3) A program to print the multiplication table of a given integer from 1 to 10.

Uploaded by

Zayn Saifi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

C Programming Assignment Tasks

The document contains code for 3 C programs: 1) A program to check if a character is a vowel or consonant. 2) A program to convert specified days into years, weeks and remaining days. 3) A program to print the multiplication table of a given integer from 1 to 10.

Uploaded by

Zayn Saifi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

COMPUTER PROGRAMMING ASSIGNMENT

Write a program to check whether the character is vowel or consonant?


#include<stdio.h>

#include<conio.h>

int main()

char ch;

printf("Enter a Character \n");

scanf("%c", &ch);

if(ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U')

printf("entered character is a vowel");

else if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')

printf("entered character is a vowel");

else

printf("entered character is a consonant");

getch();

return 0;

OUTPUT:-
Create a C program to convert specified days into years, weeks and days.

#include<stdio.h>

#include<conio.h>

int main()

int d, years, weeks, days;

printf("Enter the number of days \n");

scanf("%d",&d);

years=d/365;

weeks=(d%365)/7;

days=(d%365)%7;

printf("%d days are equal to %d years, %d weeks and %d days \n",d,years,weeks,days);

getch();

return 0;

OUTPUT:-
Create a program in C to display the multiplication table of a given integer.
#include <stdio.h>

#include <conio.h>

int main()

int i,s,prod;

printf("Enter an integer whose table is to be printed - ");

scanf("%d",&i);

for(s=1;s<=10;s++)

prod=i*s;

printf("\n %d * %d = %d",i,s,prod);

getch();

return 0;

OUTPUT:-

You might also like