Series: Subject: Topic:

# C FAQs

Showing Questions 1 - 20 of 238 Questions
First | Prev | | Next | Last Page
Sort by:
|

The C language terminator isa. Semicolonb. Colonc. Periodd. Exclamation mark

Answered by: Anitta Augustine on: May 18th, 2013

Semicolon

Answered by: BHUVANA on: Mar 3rd, 2013

A. Semicolon

Tricky C program questions

1)write a C program to find a peculiar two digit number which is three times the sum of its digits.2) bacteria are known to multiply very rapidly. If a certain container contains just one bacterium on the first day and there are twice as many on the next day. In this manner the number of bacteria in...

Answered by: Ranjini on: Mar 15th, 2013

Answer to the question 10"c /* * Write a C program to find a two digit number, the second digit of which is * smaller than its first digit by 4, and if the number was divided by ...

Answered by: ranjini on: Mar 15th, 2013

Answer to the question 1"c /* C program to find a peculiar two digit number which is three times the sum * of its digits. * Solution :- * let say number is 10x+y * According ...

Whats the output of.....>>?

#include #include void main() { int a=1; if(a=1,3,5,6) printf("good&a=%d",a); else printf("bad&a=%d",a); } }

error: #include expects "FILENAME" or
error: expected identifier or { before } token

#include

void main()
{
int a=1;
if(a=1,3,5,6)
printf("good&a=%d",a);
else

}

//Output

good&a=1

good&a=1

Need help in writing a C program using array and loop statement

Write a C program using arrays and any loop statements that asks the user to enter the number of students. For each student, enter the number of courses. The user should enter the students id number and the marks for each course. Compute and display the total and average of the students marks. sample...

Answered by: memo on: Oct 16th, 2012

use the structure to write this program

Answered by: sree on: Jul 4th, 2012

/*Write a C program using arrays and any loop statements that asks the user to enter the number of students. For each student, enter the number of courses. The user should enter the students ID number...

Program

Write a program that asks a user to type in their name, sex, age, roll number and store them! the program should then print the information the user entered (hints: use character arrays for name, sex)

Pointer drawback

What is the drawback of using pointer?

Answered by: abhijeetvv on: Dec 11th, 2012

Since the pointers point to a memory location issues of dangling pointers and wild pointers can occur. Dangling pointers are those pointers when the data at which they are pointed may have been modifi...

Stop watch

I want code for stop watch in C C++ & Java.

Main must be written asa. The first function in the programb. Second function in the programc. Last function in the programd. Any where in the program

Answered by: neha singh on: Nov 20th, 2012

D. Any where in the program.

Answered by: Karthkeyan on: Apr 20th, 2012

Any where in the program

If we declare a pointer like char *p;how much memory is allocated for pointer variable 'p'.

View all answers by winny gupta

Member Since Feb-2007 | Answered On : Feb 15th, 2007

2 bytes of memory because the pointer variable, whatever data type it maybe pointing to is always an unsigned integer as the address is always a positive integer, hence requiring 2 bytes of memory

Answered by: reetu on: Sep 30th, 2012

It allocate 2bytes in memory

Answered by: rasmita sahoo on: May 17th, 2012

2 byte for tc & 4 byte for gcc compiler

When dynamic allocation of memory is done by using malloc then how is the memory allocated in sequential or in some other format ?

Answered by: 001edward on: Sep 20th, 2012

Memory allocated is in some other format

How many times 3 occurs between 3 to 3333

Answered by: Dinesh on: Sep 14th, 2012

1336

```Code#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k=0;
for(i=3;i<=3333;i++)
{
j=i%10;
if(j==3)
{
k=k+1;
}
}
printf("times %d
",k);
}```

What will be the code for>?

Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid . For example if the input integer is 6 ,the output is shown below : 1 2 1 2 3 2 1 2 3 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5 6 5 4 3 2 1 2 3 4 5 6

Answered by: vinoth kumar on: Sep 10th, 2012

```Codeint main()
{
int n,m,i,j;
scanf("%d",&n);
for(i=1;i<=n;i++)
{ for(j=1;j<=n-i;j++)
printf(" ");
for(j=i;j>=1;j--)
printf("%d        ",j);
for(j=2;j<=i;j++)
printf("%d        ",j);
printf("
");
}
return 0;
}```

What is the size of a pointer variable?

The size of pointer variable depends on the processor architecture that is 32-bit or 64-bit.It may vary according to compiler we are used.

Answered by: Arpita Mishra on: Aug 4th, 2012

The size of a pointer variable is 2 bytes which is the size of unsigned integer as pointer variables are always used to store addresses.

Return multiple values from function

How to return multiple values in C language function?

Answered by: Arpita Mishra on: Aug 4th, 2012

Multiple values can be returned from a function by using call by address i.e. pointers intelligently.

Answered by: jbode on: Jan 3rd, 2012

Strictly speaking, a C function can only *return* a single value; you cant write something like "a,b,c=f();". However, you can write to multiple function parameters in addition to returning a value (...

C program to find a two digit no.

Write a C program to find a two digit no.. The second digit of which is smaller than its first digit by four and the number was divided by the digits sum, the quotient would be 7.

Answered by: DIVINE FREEDA JOSHUA on: Jun 14th, 2012

The second digit 4 is smaller than the first digit by 4
sum of the digits is 12
84/12=7

What is the difference between malloc and calloc

Answered by: maha on: May 12th, 2012

malloc is the memory allocation operator whereas calloc is the memory release operator

Answered by: RaviRanjan kumar on: Feb 1st, 2012

malloc: malloc create the single block of given size by user calloc: calloc creates multiple blocks of given size both return void pointer(void *)so boh requires type casting malloc: eg: int *p; p=(...

Swapping of two numbers

How to swap two numbers without using temporary variable?

```Code#include<stdio.h>
#include<conio.h>
void main()
{
int i=54,j=43;
printf("BEFORE SWAPPPED
");
printf("%d,%d
",i,j);
i=i+j;
j=i-j;
i=i-j;
printf("BEFORE SWAPPPED
");
printf("%d,%d
",i,j);
}```

Answered by: Tanuja Jaiswal on: Jan 26th, 2012

#include
void main()
{
int a,b,temp;
printf("Enter values for a and b ");
scanf("%d %d",&a , &b);
printf("values before swaping are : %d %d",a,b);
temp=a;
a=b;
b=temp;
printf("After swaping values are : a= %d b=%d,a,b);
getch();
}

Output of a++ + ++a + a++

What is the answer of a++ + ++a + a++ int a=5;c = a++ + ++a + a++;//compiler produces the answer 28!!!//how

Answered by: peter on: Mar 25th, 2012

Which operation in the following expression will be performed first?

c = a++ / b + 5;

Answered by: Asarudeen on: Feb 9th, 2012

c = a++ + ++a + ++a Compiler starts from leftmost operand

```Code1+5 = 6

a = 6

1+6 =7

a = 6+7

a =13

1+13 =14

Now

c = 6+ ++7 ++13

c = 28```

Nested if statement

How many nested if statements are allowed in c?

Answered by: jbode on: Feb 17th, 2012

Per the C language standard, there must be *at least* 127 levels of nesting.

Answered by: aman15490 on: Nov 6th, 2008

There is no such limitations you can use any no of nested if statement.

Short int and int

What is the difference between short int and int?

Answered by: jbode on: Feb 11th, 2012

The general idea is that short "always" represents a 16-bit integer, whereas int represents whatever the native word size is for that particular architecture (16- or 32-bit). "Always" is in scare quo...

Answered by: sumit on: Feb 5th, 2012

Sorry to say that actually in most of C compiler short int is also of 16 bit and they are equivalent to each other.

First | Prev | | Next | Last Page