Check if the letter is vowel or consonant
Posted on September 27, 2021by HI_TECH SK with 4 comments
C Program
#include <stdio.h>
#include <stdlib.h>
int main()
int main()
{
char c;
printf("Enter any word: ");
scanf("%c",&c);
if(c=='A'||c=='a'|| c=='E'||c=='e'||c=='I'||c=='i'||c=='O'||c=='o'||c=='U'||c=='u')
printf("%c is a vowel",c);
else
printf("%c is a Consonant",c);
}
Write a word in both Upper Case and Lower Case
Posted on September 18, 2021by HI_TECH SK with No comments
C Program
#include <stdio.h>
#include <stdlib.h>
int main()
{
char Str[10];
printf("Enter any Word: ");
scanf("%s",&Str);
printf("Word: %s\n",&Str);
printf("UPPERCASE: %s \n", strupr(Str));
printf("lowercase: %s ", strlwr(Str));
}
Python Program
S = input("Enter a sentence: ")
print("Lower case: " + S.lower())
print("Upper case: " + S.upper() )
C program to find Sin, Cos, Tan of a number
Posted on September 13, 2021by HI_TECH SK with No comments
C Program
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float x;
printf("Enter Value of X:");
scanf("%f",&x);
printf("The sin of the value is :%f\n",sin(x));
printf("The cos of the value is :%f\n",cos(x));
printf("The tan of the value is :%f\n",tan(x));
}
C program to calculate the number of letters in a word
Posted on September 12, 2021by HI_TECH SK with No comments
C Program
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char Strings[20];
printf("Enter any word ");
scanf("%s",&Strings);
int number = strlen(Strings);
printf("\nTotal number of letters in %s is: %d",Strings,number);
}
C program to get current date and time
Posted on September 10, 2021by HI_TECH SK with No comments
C Program
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
time_t ti;
time(&ti);
printf("%s",ctime(&ti));
}
C program to copy string from one variable to another variable
Posted on September 10, 2021by HI_TECH SK with No comments
C Program
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char Str1[10],Str2[10];
printf("Enter any word: ");
scanf("%s",&Str1);
printf("Copying word...\n");
strcpy(Str2,Str1);
printf("The copied word is %s",Str2);
return 0;
}
Subscribe to:
Posts (Atom)