Programming in C Journal
Programming in C Journal
#include<stdio.h>
#include<conio.h>
void main()
{
printf(“Name : Prajapati Nain Haresh\n”);
printf(“Address : DMC 4-289-V-F-4 Narottam Niwas Mitnawad Road
Khariwad Nani Daman,Daman”);
getch();
}
Q2 write a program to define variables of different datatypes and
display their values.
#include<stdio.h>
#include<conio.h>
void main()
{
char name[]=”Prajapati Nain Haresh”;
char class[]=”F.Y.BSc Computer Science”;
char div=’A’;
int rollno=19;
float per=53.85;
printf(“Name : %s\n”,name);
printf(“Class : %s\n”,class);
switch(n)
{
case ’a’: printf(“vowel a”);
break;
case ’e’: printf(“vowel e”);
break;
case ’i’: printf(“vowel I”);
switch(monthNumber)
{
while(i<5)
{
printf (“%d\n”,arr[i]);
i++;
}
getch();
}
Q15 write a program to find maximum and minimum value from one
dimension array.
#include <stdio.h>
#include<conio.h>
void main()
{
int size, I ,arr[10] ;
printf(“Enter the size of the array: “);
scanf(“%d”, &size);
printf(“Enter the elements of the array:\n”);
for (I = 0; I < size; i++)
{
scanf(“%d”, &arr[i]);
Q24 Write a program to accept numbers from the user and write all
the data into file Called “data.txt”. Then write a program to read this
file and write odd numbers Into “odd.txt” and even numbers into
“even.txt” file. Then write a program to Read the contents of both this
file.
#include< stdio.h >
#include<conio.h>
void main()
{
int n;
Q27 Write a program to count total no. of arguments and display all
arguments.
#include<conio.h>
#include< stdio.h >
void main(int argc, char *argv[])
{
int I;
printf(“\nTotal no of arguments are %d”,argc);
for(i=0;i<argc;i++)
printf(“\n\t%s”,argv[i]);
}