C Language
Description: C Language | |
Number of Questions: 15 | |
Created by: Amish Majumdar | |
Tags: C Language Java/Oracle /C/C++ |
Which of the following file opening modes in C is/are invalid?
Which of the following statements is/are correct?
Which of the following statements is/are correct?
What is the ASCII value of O (capital)?
Which of the following is/are invalid C keyword(s)?
Which of the following is/are not standard string function(s) of C library?
Which of the following statements is/are incorrect?
Which of the following operators are arranged from higher to lower priority in solving any particular expression?
Find the output of the above program or error, if any.
#include<stdio.h>
#include<conio.h>
int num(int);
int main()
{
int n=9,t;
t=num(n);
printf("\\n the result is %d",t);
getch();
}
int num(int m)
{
int f=0;
if(m==0)
return (f);
else
{
f=f+m+num(m-1);
return (f);
}
}
Which of the following statements about the above program is correct if we enter the number as 1111?
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
long n;
int x,y=0,p=0;
printf("enter number");
scanf(%d,&n);
while(n!=0)
{
x=n%10;
if(x>1 || x<0)
{
printf("invalid" );
exit(1);
}
y=y+x*pow(2,p);
n=n/10;
p++;
}
printf("answer is %d",y);
getch();
}
Find the output of the above program or error, if any.
#include<stdio.h>
#include<conio.h>
int main()
{
int a=8, b=2,c;
c=a^b;
printf(“the result is C=%d”,c);
getch();
}
Which of the following options shows the output or error of the above program?
#include<stdio.h>
#include<conio.h>
#define plus(x) x;
#define minus(x) --x + plus(x);
int main()
{
int x=8,y;
y=minus(x);
printf("y=%d",y);
getch();
}
Find the output of the program or error, if any.
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int f=1,l,i,x=4,y=4;
float s;
s=x;
for(i=2;i<=y;i+=2)
{
f=1;
for(l=1;l<=i;l++)
f=f*l;
s=s+pow(x,i)/f;
}
printf("\\n result is %f" ,s);
getch();
}
Find the output of the above program or error, if any.
#include<stdio.h>
#include<conio.h>
int main()
{
int a=4,b=8,c;
c=a | b;
printf(“the result is C=%d”,c);
getch();
}
If we enter the number as 1111, which of the following statements about the above program is/are correct?
#include
#include
#include
#include
int main()
{
long n;
int x,y=0,p=0;
printf("enter number");
scanf(%d,&n);
while(n!=0)
{
x=n%10;
i f(x>1 || x<0)
{
printf("invalid" );
exit(1);
}
y=y+x*pow(2,p);
n=n/10;
p++;
}
printf("answer is %d",y);
getch();
}