CS201 Introduction To Programming Solved MID Term Paper
CS201 Introduction To Programming Solved MID Term Paper
COM
MID TERM
54321
Infinite loop
1234
12345
int x, x = 10;
x = 10;
Let ptr1 and ptr2 are pointer variables that points to integer data
types then which one of the following arithmetic is allowed?
ptr1 + ptr2
ptr1 - ptr2
ptr1 * ptr2
ptr1 / ptr2
5,5
4,4
4,5
5,4
What will be the correct syntax for initialization of a pointer ptr with
string "programming"?
char *ptr = ‘programming’ ;
*ptr = “programming” ;
char ptr = ’programming’ ;
char *ptr = “programming” ;
#include <iostream.h>
#include<string.h>
main()
{
char name[10]= "Khaqan";
char msg[20] = "Welcome!";
cout<<strncat(msg, name, 3);
return 0;
}
Out Put (Welcome!Kha)