Give three different situations where the keyword typedef is used.
See Answer →Convert the following nested do-while loop into a nested for loop:
i = 0;
do
{
i = i+1;
j = i;
do
{
if( (i+j)%2 == 0 )
printf("%d", i);
else
printf("%d", j);
j = j+2;
}while(j < = 10);
}while(i <= 5);
Verify that you get the same output in each case.
Given any two real matrices A and B with same dimensions, define the matrix AB to be the matrix with ijth entry as if aij 6= 0 and 0 otherwise. Write a program that reads two matrices A and B from the keyboard and prints the matrix AB. The program must float an error message if the dimensions of A and B mismatch.
Write a C program that reads a list of positive integers from keyboard, and prints the number of integers divisible by 2 or 3.
See Answer →What is wrong with the following declaration? Explain. float *number = 2.30;
See Answer →Give an example to illustrate the use of ternary if-then-else statement
See Answer →Write a program that reads the date of birth of a person from the keyboard and prints his/her age in years, months and days. The date of birth is supposed to be in the format DD-MM-YYYY.
See Answer →Arrange the following operators in descending order of their priority. If any two operators have the same priority, then specify their associativity.
+ = % + [ ] ! = − () − >
See Answer →What is a pointer variable to a pointer? Where is it used? explain with an example
See Answer →Write the output of the following C codes, with proper justification for each.
i) main()
{
int i = 5, j = 6, k = 7;
printf("%d", i++ - ++j + ++k);
}
ii) main()
{
char day[10] = "SUNDAY";
day[0] = 77;
day[1] = 79;
printf("%s", day);
}
iii) main()
{
int i = 3;
while(i--)
{
int i = 1;
printf("%d ", i);
i++;
}
}
iv) int f(int n)
{
if(n < 1)
return n;
else
return n*n + f(n-1);
}
main()
{
printf("%d", f(5));
}
v) struct employee
{
char name[20];
int id;
long salary;
}emp = {"Piyush", 1, 50000};
main()
{
printf("Name = %s ", emp.name);
printf("ID =%d", emp.id);
printf("Salary = %d", emp.salary);
}
Public sector and private sector
See Answer →Tertiary education and primary education
See Answer →Industrial sector reforms and financial sector reforms
See Answer →Underdevelopment and development
See Answer →Trade in services
See Answer →Ever green technology
See Answer →Poverty line
See Answer →Hydro power
See Answer →Explain the importance of WTO
See Answer →Explain the various initiatives taken by the Government to help the growth of MSMEs.
See Answer →