Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);
A. char p = *malloc(100);
B. char *p = (char) malloc(100);
C. char *p = (char*)malloc(100);
D. char *p = (char *)(malloc*)(100);
Programming Language: C
We speak a language that bring the whole world together. This page is dedicated to beginner and intermediate students.
Please feel free to share and solve problems of one another in c language.
hey friends....
need a programmer.. who can manage all d posts on dis page.... so any1 who wants to be admin can comment
83)
using namespace std;
int main()
{
char *ptr;
char Str[] = "abcdefg";
ptr = Str;
ptr += 5;
cout
82)
using namespace std;
int main()
{
char arr[20];
int i;
for(i = 0; i < 10; i++)
*(arr + i) = 65 + i;
*(arr + i) = '\0';
cout
81)
p(a,b) a #
call(x)
int main()
{
do
{
int i=15,j=3;
printf("%d",p(i-+,+j));
}
while(*(call(625)+3));
return 0;
}
80) main()
{
int i=5,j=10;
i=i&=j&&10;
printf("%d %d",i,j);
}
Reply fast.....:)
79)
What will be output of the following c program?
static num=5;
int num;
extern int num;
int main()
{
printf("%d",num);
return 0;
}
(A) 5
(B) 10
(C) 0
(D) Compilation error
(E) None of these
78.If the following program(myprog) is run from the command line
as:myprog monday
tuesday wednesday
thursday
What would be the output?
int main(int argc, char*argv[])
{
while(--argc
#77. Wht will be d output... Nd y?
include
main()
{
float a=9.2;
if(a==9.2)
printf("a is equal");
else
printf("not equal");
getch();
}
#76.
int i;
main(){
int t;
for ( t=4;scanf("%d", &i)-t;printf
("% d\n",i))
printf("%d--",t --);
}
// If the inputs are 0,1,2,3 find the
o/p
Answer:
4--0
3--1
2--2
expln ?
#75. Write d program to print as follow
5 5 5 5 5
4 4 4 4 5
3 3 3 4 5
2 2 3 4 5
1 2 3 4 5
74.
int main()
{
char *strng[30] =
{"Hello"};
printf("%s",atoi(strng));
printf("\n");
return 0;
}
output is showing null,
why??
can anybody explain
Click here to claim your Sponsored Listing.