Previously Asked Questions in C -R20

Write a program that uses an array of character pointers to display the name of the day corresponding to the given number.
#include<stdio.h>
#include<string.h>
void main()
{
    int dayno;

    char *dayname[] = {
                         "Monday",
                         "Tuesday",
                         "Wednesday",
                         "Thursday", "Friday","Saturday","Sunday"
                     };

   printf("Input Day No : ");
   scanf("%d",&dayno);
   switch(dayno)
   {
	case 1:
	       printf("%s",dayname[0]);
	       break;
	case 2:
	       printf("%s",dayname[1]);
	       break;
	case 3:
	       printf("%s",dayname[2]);
	       break;
	case 4:
	       printf("%s",dayname[3]);
	       break;
	case 5:
	       printf("%s",dayname[4]);
	       break;
	case 6:
	       printf("%s",dayname[5]);
	       break;
	case 7:
	       printf("%s",dayname[6]);
	       break;
	default:
	       printf("Invalid day number.\nPlease try again .\n");
	       break;
	}
 getch();
}

12 comments:

  1. The Python Training Course in Noida offers a structured and practical approach to learning. Whether you are a beginner or an experienced programmer, this course caters to individuals of all levels. The curriculum covers the fundamentals of Python, including data types, variables, loops, functions, and object-oriented programming. You will also gain hands-on experience by working on real-world projects, allowing you to apply your newly acquired skills in a practical setting.

    ReplyDelete
  2. Digital Career Guru Digital Career Guru institute of Digital Marketing is one of the best Digital Marketing Institute in Delhi – NCR. We have framed a full-fledged Advance Digital Marketing Course with Industry Expert Trainers .

    ReplyDelete
  3. b.ed direct admission college list  B.Ed direct admission program offers a simplified and hassle-free pathway to kickstart your journey towards a rewarding teaching career.

    ReplyDelete
  4. It is a great blog post! it is more informative and engaging. You put thought and effort into your content. I keep looking forward to more posts from you. Keep up the good work!
    Python Training in Electronic City Bangalore

    ReplyDelete
  5. Our courses are led by industry experts and seasoned Python professionals who bring real-world experience to the classroom. They are dedicated to ensuring that you grasp the fundamentals and gain practical insights into Python programming. The Python Training Course in Noida at APTRON Solution covers a wide range of topics, including Python basics, data types, control structures, functions, object-oriented programming, and more. The curriculum is designed to give you a strong foundation and make you proficient in Python.

    ReplyDelete
  6. Python Training in Gurgaon at APTRON is a transformative learning experience that equips aspiring developers and IT professionals with the skills necessary to navigate the dynamic landscape of programming. APTRON's commitment to excellence and individualized attention makes it a standout choice for anyone looking to embark on a rewarding journey in Python programming in the thriving city of Gurgaon.

    ReplyDelete
  7. Wow! This blog is so detailed.
    Check the SAP business one blog, This is just like the same thing But in more depth.
    Also This erp software for smes surrey.

    ReplyDelete
  8. If you are having any problems related to cars, We offer Winch out and Recovery surrey
    We also offer Underground Towing richmond
    Be sure to check them out because we also offer Underground Towing in coquitlam

    ReplyDelete
  9. Wow! This blog is so detailed.
    Check the smm Abbotsford blog, This is just like the same thing But in more depth.
    Also This website development services surrey.

    ReplyDelete
  10. At APTRON Solutions, we are committed to providing top-notch Python Training Institute in Noida. Our goal is to help you develop the skills and confidence to thrive in the tech industry. Join our Python training program today and take the first step towards a successful programming career.

    ReplyDelete
  11. Unlock the full potential of JavaScript with APTRON Gurgaon's comprehensive NodeJs Course in Gurgaon. Designed for both beginners and experienced developers, this course provides hands-on training in building scalable, fast, and real-time web applications. Whether you are looking to enhance your skillset or start a career in backend development, APTRON Gurgaon ensures you are industry-ready with expert guidance and practical exposure.

    ReplyDelete