C Programming By Neeraj Sir

C Programming By Neeraj Sir

Share

Hello Students In this Page You Will Get All The Solution Of C Programs. Call - 8981997730

24/10/2022

Happy Diwali

31/12/2020

Happy New Year 2k21

09/03/2020

Happy Holi

01/03/2020

/*45.C program to check whether a character is VOWEL or CONSONANT using switch.*/
//by neeraj JHA


int main()
{
char ch;

printf("Enter a character: ");
scanf("%c",&ch);

//condition to check character is alphabet or not
if((ch>='A' && ch='a' && ch

01/03/2020

//44. C program to read gender (M/F) and print corresponding gender using switch.
//BY Neeraj Jha
/*C program to read gender (M/F) and print corresponding gender using switch.*/



int main()
{
char gender;

printf("Enter gender (M/m or F/f): ");
scanf("%c",&gender);

switch(gender)
{
case 'M':
case 'm':
printf("Male.");
break;
case 'F':
case 'f':
printf("Female.");
break;
default:
printf("Unspecified Gender.");
}
printf("\n");
return 0;
}

01/03/2020

//43.C program to read weekday number and print weekday name using switch.
//BY NEERAJ JHA
/*C program to read weekday number and print weekday name using switch.*/



int main()
{
int wDay;

printf("Enter weekday number (0-6): ");
scanf("%d",&wDay);

switch(wDay)
{
case 0:
printf("Sunday");
break;
case 1:
printf("Monday");
break;
case 2:
printf("Tuesday");
break;
case 3:
printf("Wednesday");
break;
case 4:
printf("Thursday");
break;
case 5:
printf("Friday");
break;
case 6:
printf("Saturday");
break;
default:
printf("Invalid weekday number.");
}
printf("\n");
return 0;
}

01/03/2020

//42.Calculate the distance between two cities from kilometers to meters, centimeters, feet and inches using C program
//BY NEERAJ JHA

/* calculate the distance in meter, feet,
inches and centimeter
*/



int main()
{
/*Declare the variables*/
int distance;
float meter;
float feet;
float inches;
float centimeter;

/*input the value of distance through the keyboard*/
printf("Enter the distance between Gwalior and Delhi (in KM): ");
scanf("%d", &distance);

/* converting the distance into meters, feet,
inches, and, centimeter
*/
meter = distance * 1000;
feet = distance * 3280.84;
inches = distance * 39370.1;
centimeter = distance * 100000;

/*printing the results*/
printf("Meter = %f\n", meter);
printf("Feet = %f\n", feet);
printf("Inches = %f\n", inches);
printf("Centimeters = %f\n", centimeter);

return 0;
}

01/03/2020

41.PRINT RANDOM NUMBER
//BY NEERAJ JHA



int main(void)
{
printf("Random number is: %d ", rand());
return 0;
}

01/03/2020

// 32.SET BUFFER WITH SPECIFIC VALUE USING memset in C
//by neeraj


int main()
{
unsigned char buffer[10]={0};
int i;
printf("buffer:%s\n",buffer);
//set value with space
memset(buffer,' ',9);//last byte should be null
printf("buffer (memset with x): %s",buffer);
printf(".\n");
//set value with x
memset(buffer,' x',9);//last byte should be null
printf("buffer (memset with x): %s",buffer);
printf(".\n");
//set value with 15
memset(buffer,15,9);//last byte should be null
printf("buffer (memset with 15): %s",buffer);
printf(".\n");
printf("buffer (memset value 15 printing integer valuesa :\n*** LAST VALUE WILL BE NULL *** : \n");
for(i=0;i

Want your school to be the top-listed School/college in Bhopal?

Click here to claim your Sponsored Listing.

Location

Category

Telephone

Address


Bhopal