-1
#include<iostream.h>
#include<conio.h>
void main()
{
    clrscr();
    cout<<"Let initial states be 0 0\n";
    int Q0,Q1,D0,D1;
    Q0=0;
    Q1=0;
    cout<<Q0<<"\t"<<Q1;
    int Dff(int clk,int D) {
        int Q;
        if((D==0||D==1)&&clk==1) {
            Q=D;
            return(Q);
        }
    }
    int NOR(int a,int b) {
        int out;
        if(a==0&&b==0) {
            out=1;
            return(out);
        }
        if(a==1||b==1) {
            out=0;
            return(out);
        }
    }
    do {
        D0=NOR(Q0,Q1);
        D1=Q0;
        Q0=Dff(1,D0);
        Q1=D1;
        cout<<Q0<<"\t"<<Q1;
    } while(Q0==0&&Q==0);
    getch();
}

my code is this and ther is Declaration Syntax Error at line no.12 please tell me the reason and the remedy soon.

Edited by Narue: Added code tags and formatting

4
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by m4ster_r0shi
0

Looks like C++ for me. Not "related to the C language as per the ANSI C standard." at least.

Edited by pyTony: n/a

0

Looks like C++ for me.

True, but irrelevant to the question. C++ does not allow nested functions either. ;)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.