Friday, December 13, 2013

Question & Answer



Dear Students,


if you have any questions regrading fundamental of computers & Programming in C.  Post your questions Clearly in the Comment box given below. I will try to post the answer with in 24 hours



Thanks & Regards

Shiraz Khurana

8 comments:

  1. Sir,
    do we have online and offline processing in syllbus??

    ReplyDelete
  2. What is the output of the following & give reason- int a=99; printf("%d%d%d",a++,++a,++a,a++);

    ReplyDelete
    Replies
    1. Mr. Sanjay in C language whenever you pass argument to a function it will be assigned from right to left. In this case printf is function so argument will be passed from right to left. So firstly a++ will be passed then ++a followed by ++a & a++ (Right to left). i think you have made a typing mistake in typing the control string that is %d, you have given 4 variables but now it will print result of only three variables that is first three. so the output would be 102102101. if you add one more %d then the output would be 10210210199. I am assuming that you know the details of postfix & prefix operators. if you don't refer to the following link
      http://www.shirazkhurana.com/2013/09/increment-decrement-operator-tutorial.html

      Delete
  3. respected sir
    please tell that can i leave topic of interconersion of binary to decimal.....and also algorithum and flowchart
    the ques bank is sufficient that u have uploaded
    please tell me some 10 programes in c
    and half of unit 4 plz tell some important ques so that i will bw able to attempt aleast one ques frm unit 4 its an kind request sir
    and there is a ques onnline and offline proceessing from operating system topic it is in previous ques kuk june 2007
    please tell my queries sir

    ReplyDelete
    Replies
    1. NO you can not leave any interconversion , algorithm & flowchart topic these are most important one. program jo class main cover hue hai & in lab as well vo kar jana 90 % chance hai unse bahar nahi aayega.

      4th unit main se jo most important hai vo structure union & enumeration, strings most probably isme se 20 marks ka to aa hi jaagea.

      as per your question on OS. operating system main online & offline processing rare question hai. Chances are less ke vo repeat ho. Baaki operating system ka basics hi aate hai 99% times.. baaki if u want to do it.. it is given in J.B. Dixit

      Delete
  4. #include
    #include
    main()
    {
    long int a,i,small,n,b;
    printf("\nplease enter a number");
    scanf("%ld",&a);
    printf("\nhow many digits are this nunber?");
    scanf("%ld",&i);
    small=a%10;
    for(n=1;n<i;n++)
    {
    a=a/10;
    b=a%10;
    if(b<small)
    {
    small=b;
    }
    }

    printf("\nthe small value in this number is%ld",small);

    }

    sir,
    this program to find out small digit in a no.
    it works correct under 9 digit .
    when i enter 10 digit it give incorrect output.
    why?????
    this program is written in codeblocks ....

    ReplyDelete
    Replies
    1. #include
      #include
      main()
      {
      unsigned long int a; // 0 to 4,294,967,295
      int i,small,n,b;
      printf("\n please enter a number");
      scanf("%ld",&a);
      printf("\n how many digits are this nunber?");
      scanf("%ld",&i);
      small=a%10;
      for(n=1;n<i;n++)
      {
      a=a/10;
      b=a%10;
      if(b<small)
      {
      small=b;
      }
      }

      printf("\nthe small value in this number is%ld",small);

      }

      Delete