whether a character intered through the keyboard is a special symbol or not

 whether a character entered through the keyboard is a special symbol or not

#include<stdio.h 

int main(){

char ch;

printf("Enter a character \n");

scanf(""%c",&ch);

((ch>=0 && ch<=47)||

(ch>=58&&ch<=64)||

(ch>=91&&ch<=96)||

(ch>=123))?

printf("character entered is a special symbol\\n):

printf("character entered is not a special symbol\\n);

return 0;

 Enter a character:  @

 character entered is a special symbol

 



 related program--

1..whether the character Entered through the keyboard is a lower case alphabet or not

2..The body mas index (BMI) is defined as ratio of the weight of the person (in kilometer) to the square oef height (in meters) . write a program that receive weight and height calculate the BMI and report the BMI category as per the following table .

3..A certain grade of steel is graded according to following condition: (i) Hardness must be greater than 50. (ii)carbon content must be less than 0.7 (iii)Tensile strength must be greater than 5600. the grades as follows: grade is 10 if all three condition are met, Grade is 9 if conditions (i)and (ii) are met , Grade is 8 if condition (ii) and (iii) are met , Grade is 7 if condition (i) and (iii) are met, Grade is 6 if only one condition is met , Grade is 5 if none of the conditions are met . write a program which will require the user to give values of hardness , carbon content and tensile strength of the steel under consideration and output the grade of steel 

4...A digital world colors are specified in Red ,Green ,Blue(RGB) format with value of (R,G,B) varying on integers scale from 0 to 255 in point publishing the colors are mentioned in cyan, magenta - yellow black (CMYK) format ,with value of C,M,Y and k varying on real scale from 0.0 to 1.0 write the program to convert RGB colors to CMYK as per the following formula.. White=max(Red/255,Green/255,Blue/255), cyan=(white-Red/255)/white Magenta=(white -Green/255)/white black = 1-white. note that if RGB value are all 0 then the cmy values are all 0 and the k value is 1.

Comments

Popular posts from this blog

if the marks obtain by a student in five different subjects are input through the keyboard write a program to find out the aggregate marks and percentage marks obtained by the student. assume that the maximum marks that can be obtained by a student in each subject is 100.

If lengths of three sides of a tringle are input through the keyboard write a program to find the area of tringle.

the length and breadth of a rectangle and radius of a circle are input through the keyboard. write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle