WB JECA MCA C Programming Language Previous Year Questions (PYQs) – Page 3 of 3

WB JECA MCA C Programming Language Previous Year Questions (PYQs) – Page 3 of 3

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations
logo

25.What is the output of the following program ?  include <iostream>  using namespace std;  int addition (int a, int b)  {   return a+b;  }  double addition (double a, double b)  {   return a+b;  }  int main ()  {   cout<< addition (35,20) << “;”;   cout<< addition (34.1,12.7);   return 0;  } 

1
2
3
4

logo

26.What is the output of the following program ?  #include <iostream>  using namespace std;  template <class C1, class C2>  bool is_equal (C1 var1, C2 var2)  {   return (var1 = = var2);  }  int main ()  {   if (is_equal(10,10.0))    cout<< “Equal”;   else    cout<< “Not equal”;   return 0;  } 

1
2
3
4

logo

26.What is the output of the following program ?

#include <iostream>
using namespace std;

int main() 
{
    int var = 0;
    while (var < 10) 
    {
        cout << var << " ";
        var++;
    }
    cout << var;
    return 0;
}


1
2
3
4

logo

What is the output of the following program ?
#include <iostream>
using namespace std;
struct demo
{
    int var;
};
int main()
{
    demo str;
    demo *ptr;

    str.var = 100;
    ptr = &str;
    cout << ptr->var;
    return 0;
}


1
2
3
4

logo

29.What is the output of the following program ?
#include <iostream>
using namespace std;
int main ()
{
    int c1 = 10;
    int c2 = 20;
    {
        int c1;
        c1 = 50;
        c2 = 50;
        cout << "c1= " << c1 << ", c2=" << c2;
    }
    cout << ", c1= " << c1 << ", c2=" << c2;
    return 0;
}


1
2
3
4

logo

30.What is the output of the following program ?
#include <iostream>
using namespace std;

class Demo {
public:
    static int count;
    Demo() { count++; }
};

int Demo::count = 0;

int main() {
    Demo var1;
    Demo var2[5];
    cout << var1.count;
    return 0;
}


1
2
3
4

logo

31.What is the output of the following program ?
#include <iostream>
using namespace std;

void print();
int main()
{
    int var = 0;
    var = print();
    cout << var;
    return 0;
}

void print()
{
    cout << "Hi";
}


1
2
3
4

logo

32.What is the output of the following program ?
#include <iostream>
using namespace std;

int main()
{
    int var = 2;
    do
    {
        cout << var;
    } while (var--);
    return 0;
}


1
2
3
4

WB JECA MCA


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

WB JECA MCA


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...