Solution of Old is gold of computer programming grade 12 2075 set A

Solution of Old is gold of computer programming grade 12 2075 set A


2076 Set A Q. No. 1a

What is loop? Differentiate between while loop and do while loop.

What is loop?

Click here

Differentiate between while loop and do-while loop

Click here

 2076 Set A Q. No. 2

Write a C program to input 10 integers number into an array and display the sum of the numbers.

#include<stdio.h>

#include<conio.h>

void main()

{

          int num[10], i, j, s=0;

          printf("\n Enter 10 integers");

          for(i=0;i<10;i++)

          {

                   scanf("%d", &num[i]);

          }

          for(i=0;i<10;i++)

          {

                   s=s+num[i];

          }

          printf("\n Sum=%d",s);

          getch();

}

Output



 2076 Set A Q. No. 3

What is function? Explain any four-string function with examples

What is function?

Click here

Explain any four-string function with examples

Click here

2076 Set A Q. No. 4

Write a C program to input name, roll, and reg. no of 10 students using structure and display it proper format

#include<stdio.h>

#include<conio.h>

void main()

{

          struct record

          {

          int roll, reg;

          char name[30];

    };

    struct record a[10];

    int i;

          printf("\n Enter Roll no. ,Name and Reg.no of 10 students");

          for(i=0;i<10;i++)

          {

                   scanf("%d%s%d", &a[i].roll, a[i].name, &a[i].reg);

          }

          for(i=0;i<10;i++)

          {

                   printf("\n Roll no=%d\t Name=%s\t Reg no.=%d", a[i].roll, a[i].name, a[i].reg);

          }

          getch();

}

Output



 

 

 

 

Post a Comment

0 Comments