The C language terminator isa. Semicolonb. Colonc. Periodd. Exclamation mark
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...
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 ...
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 ...
#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
printf("bad&a=%d",a);
}
//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...
use the structure to write this program
/*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...
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)
What is the drawback of using pointer?
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...
I want code for stop watch in C C++ & Java.
D. Any where in the program.
Any where in the program
If we declare a pointer like char *p;how much memory is allocated for pointer variable 'p'.
Answered by: winny gupta
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
It allocate 2bytes in memory
2 byte for tc & 4 byte for gcc compiler
Memory allocated is in some other format
How many times 3 occurs between 3 to 3333
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; } } ",k); }
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
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.
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?
Multiple values can be returned from a function by using call by address i.e. pointers intelligently.
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.
The answer is 84
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
malloc is the memory allocation operator whereas calloc is the memory release operator
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=(...
How to swap two numbers without using temporary variable?
#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();
}
What is the answer of a++ + ++a + a++ int a=5;c = a++ + ++a + a++;//compiler produces the answer 28!!!//how
Which operation in the following expression will be performed first?
c = a++ / b + 5;
c = a++ + ++a + ++a Compiler starts from leftmost operand
Code
1+5 = 6 a = 6 1+6 =7 a = 6+7 a =13 1+13 =14 Now c = 6+ ++7 ++13 c = 28
How many nested if statements are allowed in c?
What is the difference between short int and int?
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...
Sorry to say that actually in most of C compiler short int is also of 16 bit and they are equivalent to each other.
Semicolon
A. Semicolon