Tuesday 17 September 2019

Filled Under:

ONLINE EXAMINATION[c programming language]

ONLINE EXAMINATION

Program:

#include<stdio.h>
#include<conio.h>
void prn();
main()
{
int i,m=0;
long ht;
char name[20];
char f[10];
char ch[50]="STATE TRUE OR FALSE. EACH CARRIES ONE MARK.";
clrscr();
prn();
gotoxy(5,4);
printf("STUDENT NAME    : ");
scanf("%s",name);
gotoxy(5,6);
printf("HALLTICKET NUMBER : ");
scanf("%ld",&ht);
clrscr();
prn();
gotoxy(2,5);
printf("%s",ch);
gotoxy(2,6);
for(i=0;i<strlen(ch);i++)
printf("-");
printf("\n\n");
printf("1. Structure is not a data type :");
scanf("%s",&f[0]);
if(f[0]==101  ||  f[0]==70)
m++;
printf("\n");
printf(2. C program is a collection of functions:");
scanf("%s",&f[1]);
if(f[1]==116 || f[1]==80)
m++;
printf("\n");
printf("3. In an array we can accept more than one value of same type :");
scanf("%s",&f[2]);
if(f[2]==116  || f[2]==84)
m++;
printf("\n");
printf("4. String is a character array :");
scanf("%s",&f[3]);
if(f[3]==116 || f[3]==84)
m++;
printf("\n");
printf("5. Any function cannot be called from any other function :");
scanf("%s",&f[4]);
if(f[4]==102 || f[4]==70)
m++;
printf("\n");
printf("6.fflush() is a macro: ");
scanf("%s",&f[5]);
if(f[5]==102 || f[5]==70)
m++;
printf("\n");
printf("7. When the file is opened in 'a+' mode modification is possible: ");
scanf("%s",&f[6]);
if(f[6]==102 || f[6]==84)
m++;
printf("\n");
printf(8. Break is a reverse word: ");
scanf("%s",&f[7]);
if(f[7]==116 || f[7]==84)
m++;
printf("\n");
printf("9. STRCHR finds the first occurrence of a given character in a string: ");
scanf("%s",&f[8]);
if(f[8]==116 || f[8]==84)
m++;
printf("\n");
printf("10. FILE STRUCTURE CONTAINS INFORMATION ABOUT THE FILE BEING USED: ");
scanf("%s",&f[9]);
if(f[9]==116 || f[9]==84)
m++;
clrscr();
prn();
printf("\n\n");
printf("STUDENT NAME               :%s",name);
printf("\n HALL TICKET NUMBER      :%ld",ht);
printf("\nTOTAL MARKS              :%d",m);
getch();
}
void prn()
{
gotoxy(25,2);
printf("C EXAMINATION");
gotoxy(25,3);
printf("_____________");
}

Output:
                                              C EXAMINATION
STUDENT NAME                : Avinash
HALL TICKET NUMBER   : 9192001

                                              C EXAMINATION
1.Structure is not a data type:f
2. C program is a collection of functions:t
3. In an array we can accept more than one value of same type :t
4. String is a character array :t
5. Any function cannot be called from any other function :f
6.fflush() is a macro:f
7. When the file is opened in 'a+' mode modification is possible:f
8. Break is a reverse word:t
9. STRCHR finds the first occurrence of a given character in a string: t
10. FILE STRUCTURE CONTAINS INFORMATION ABOUT THE FILE BEING USED:t

                                              C EXAMINATION
STUDENT NAME                  : Avinash
HALL TICKET NUMBER     :9192001
TOTAK MARKS                     :10


                                  Best Budget Laptop For Web Developers 2019

Best Budget Laptop For Programmershttps://amzn.to/2LOr3w9
Mi Fitness Band (On Offer) -   https://amzn.to/2AxC7IF
Honor Band 4(Fitness Band)https://amzn.to/2NkLjZz

0 komentar:

Post a Comment