Initializing
pointer with zero :
#include<stdio.h>
# include
<stdlib.h>
int main()
{
int *iptr;
iptr=0;
if(iptr==0)
puts("ok");
else
puts("not
ok");
}
Pointers
and Multidimensional Arrays:
It is usually
best to allocate an array of pointers, and then initialize each pointer to a
dynamically allocated row. Here is an example:
#include<stdio.h>
# include <stdlib.h>
int main()
{
int row=5,col=5;
int **arr,i,j;
arr=(int**)malloc(row*sizeof(int*));
for(i=0;i<row;i++)
{
arr[i]=(int*)malloc(col*sizeof(int));
}
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
scanf("%d",&arr[i][j]);
}
}
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
printf("%3d",arr[i][j]);
printf("\n");
}
}
1.
Explain the evolution of computers.
2.
With suitable diagram explain about computer
organization
3.
With a suitable example, explain about Number
Systems.
4.
Explain the various types of softwares with
suitable examples.
5.
Explain in detail about the software development
steps.
6.
Draw a flowchart to multiply two matrices.
7.
Write the pseudo code to multiply two matrices.
8.
What is an algorithm? Write an algorithm to
print even numbers from 2 to 100.
9.
Explain any 8 formatting features with an
example for each.
10.
Explain the various looping constructs. Give an
example fo each and explain the working of the construct.
11.
Write a C program to find the sum of the series
Simple Level:
_A_
1.
Write a c program to print ASCII value of all
characters.
2.
sub two
numbers without using arithmetic operators
3.
addition
two numbers without using arithmetic operators
4.
multiplication two numbers without using
arithmetic operators
5.
reminder of two numbers without using modules
operators
6.
Factorial of given number.
7.
print fibonacci numbers upto the given range.
8.
Program to find power of given number.(use
loops)
9.
write a program to convert binary to decimal
10.
write a program to convert decimal to binary?
Medium Level:
_B_
1.
Write a c program for swapping of two arrays
2.
Swapping of strings using c programming language
3.
Program to convert string into ASCII values in c
4.
Program to count number of alphabets, digits and
special characters in string?
5.
find duplicate numbers in an array.
6.
insert or delete a number in an array
7.
sort array elements.
8.
find the max and min value of an array?
9.
read 3x3 matrix and print diagonal sum?
10.
Program to check perfect number or not.
Complex Level:
_C_
1.
C program to prints initial of any name
2.
Write a C program to delete all vowels from a
sentence.
3.
C program to insert a sub-string in to given
main string from a given position.
4.
C Program to delete n characters from a given
position in a given string.
5.
Write a C program to delete all consonants from
a sentence.
6.
C Program – Sorting of a Set of Strings in
Ascending alphabetical order
7.
C program to print count of all the characters
occurrences in given string?
8.
Read a string 'i love java' and print 'java love i'
9.
accept 5 strings and copy all strings to another
string.
10.
Program to Remove Characters in String Except
Alphabets
No comments:
Post a Comment